#include <sstream>
#include "pca.h"
Go to the source code of this file.
◆ rotate
#define rotate |
( |
|
a, |
|
|
|
i, |
|
|
|
j, |
|
|
|
k, |
|
|
|
l |
|
) |
| |
Value: a[
i][
j] =
g - s *(h +
g*tau); \
a[
k][l] = h + s*(
g - h*tau);
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
◆ operator<<() [1/2]
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const PCAAnalyzer & |
PC |
|
) |
| |
Show relevant eigenvectors and eigenvalues
Definition at line 369 of file pca.cpp.
371 out <<
"Relevant Dimension: " << PC.
get_Dimension() << std::endl;
372 out <<
"Mean vector: ";
373 int size = PC.
mean.size();
374 out <<
"(" << size <<
") ---> ";
375 for (
int j = 0;
j < size;
j++)
376 out << PC.
mean[
j] <<
" ";
380 out << PC.
eigenval[
i] <<
" (" << size <<
") ---> ";
381 for (
int j = 0;
j < size;
j++)
int get_Dimension() const
std::vector< FeatureVector > eigenvec
◆ operator<<() [2/2]
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const PCA_set & |
PS |
|
) |
| |
Show all PCA
Definition at line 438 of file pca.cpp.
440 int imax = PS.
PCA.size();
441 out <<
"Number of PCAs: " << imax << std::endl;
442 for (
int i = 0;
i < imax;
i++)
std::vector< PCAAnalyzer > PCA
◆ operator>>() [1/2]
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
PCAAnalyzer & |
PC |
|
) |
| |
Read a set of PCA just as shown
Definition at line 388 of file pca.cpp.
392 std::string read_line;
393 getline(
in, read_line);
394 sscanf(read_line.c_str(),
"Relevant Dimension: %d", &D);
400 getline(
in, read_line);
401 sscanf(read_line.c_str(),
"Mean vector: (%d) --->", &size);
402 read_line.erase(0, read_line.find(
'>') + 1);
403 PC.
mean.resize(size);
404 std::istringstream istr1(read_line.c_str());
405 for (
int j = 0;
j < size;
j++)
408 for (
int i = 0;
i < D;
i++)
410 getline(
in, read_line);
412 sscanf(read_line.c_str(),
"%f (%d) ---> ", &
f, &size);
414 read_line.erase(0, read_line.find(
'>') + 1);
416 std::istringstream istr2(read_line.c_str());
417 for (
int j = 0;
j < size;
j++)
void set_Dimension(int _D)
std::vector< FeatureVector > eigenvec
◆ operator>>() [2/2]
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
PCA_set & |
PS |
|
) |
| |
Read a set of PCA just as shown
Definition at line 447 of file pca.cpp.
450 std::string read_line;
451 getline(
in, read_line);
452 sscanf(read_line.c_str(),
"Number of PCAs: %d\n", &imax);
454 for (
int i = 0;
i < imax;
i++)
std::vector< PCAAnalyzer > PCA