31 "rank-1) * (matrixSize - rank/2) == angles.size()");
32 Matrix m(matrixSize, matrixSize);
36 for (
Size j=1; j<matrixSize; ++j)
42 Real sinProduct = 1.0;
43 Size bound = std::min(i,rank-1);
44 for (
Size j=0; j<bound; ++j) {
45 m[i][j] = std::cos(angles[k]);
46 m[i][j] *= sinProduct;
47 sinProduct *= std::sin(angles[k]);
50 m[i][bound] = sinProduct;
51 for (
Size j=bound+1; j<m.
rows(); ++j)
60 Matrix m(matrixSize, matrixSize);
64 cosPhi = std::cos(angles[i-1]);
65 sinPhi = std::sin(angles[i-1]);
71 for (
Size j=0; j<i; ++j)
72 m[i][j] = sinPhi * m[i-1][j];
88 angles[i] =
M_PI*.5 - std::atan(x[i]);
98 angles[i] =
M_PI*.5 - std::atan(x[i]);
106 Real t = t0 * (1 - std::exp(epsilon*
Real(i)));
108 m[i][0] = std::cos(
t)*std::cos(phi);
109 m[i][1] = std::sin(
t)*std::cos(phi);
110 m[i][2] = -std::sin(phi);
118 "the parameter array must contain exactly 3 values" );
138 for (
Size j=0; j<i; ++j){
139 result[k] = differences[i][j];
1-D array used in linear algebra.
Size size() const
dimension of the array
Real value(const Array &x) const override
method to overload to compute the cost function value in x
Array values(const Array &x) const override
method to overload to compute the cost function values in x
ext::function< Matrix(const Array &, Size, Size)> f_
Matrix used in linear algebra.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
Matrix lmmTriangularAnglesParametrization(const Array &angles, Size matrixSize, Size)
Matrix triangularAnglesParametrizationRankThree(Real alpha, Real t0, Real epsilon, Size matrixSize)
Returns the rank reduced Triangular Angles Parametrized correlation matrix.
Matrix triangularAnglesParametrization(const Array &angles, Size matrixSize, Size rank)
Returns the Triangular Angles Parametrized correlation matrix.
Matrix triangularAnglesParametrizationRankThreeVectorial(const Array ¶meters, Size nbRows)
Matrix triangularAnglesParametrizationUnconstrained(const Array &x, Size matrixSize, Size rank)
Matrix lmmTriangularAnglesParametrizationUnconstrained(const Array &x, Size matrixSize, Size rank)
Matrix transpose(const Matrix &m)
Real DotProduct(const Array &v1, const Array &v2)