26 : euclideanDimension_(euclideanDimension) {}
31 "missized vector passed to "
32 "BasisIncompleteOrdered::addVector");
85 for (
Size i=0; i <
v.columns(); ++i)
86 x +=
v[row][i]*
v[row][i];
94 return std::sqrt(normSquared(
v, row));
97 Real innerProduct(
const Matrix&
v,
Size row1,
const Matrix& w,
Size row2)
101 for (
Size i=0; i <
v.columns(); ++i)
102 x +=
v[row1][i]*w[row2][i];
112 Real multiplierCutoff,
114 : originalVectors_(originalVectors),
115 multiplierCutoff_(multiplierCutoff),
116 numberVectors_(originalVectors.rows()),
117 dimension_(originalVectors.columns()),
118 validVectors_(true,originalVectors.rows()),
119 orthoNormalizedVectors_(originalVectors.rows(),
120 originalVectors.columns())
137 for (
Size l=0; l < k; ++l)
150 if (normBeforeScaling < tolerance)
156 Real normBeforeScalingRecip = 1.0/normBeforeScaling;
182 Real sizeMultiplier = prevNormSquared/projectionOnOriginalDirection;
1-D array used in linear algebra.
const_iterator end() const
Size size() const
dimension of the array
const_iterator begin() const
Matrix getBasisAsRowsInMatrix() const
std::vector< Array > currentBasis_
Size euclideanDimension() const
BasisIncompleteOrdered(Size euclideanDimension)
bool addVector(const Array &newVector)
return value indicates if the vector was linearly independent
Matrix used in linear algebra.
Matrix orthoNormalizedVectors_
workspace
OrthogonalProjections(const Matrix &originalVectors, Real multiplierCutOff, Real tolerance)
Size numberValidVectors() const
const std::valarray< bool > & validVectors() const
Matrix originalVectors_
inputs
const std::vector< Real > & GetVector(Size index) const
std::valarray< bool > validVectors_
outputs
std::vector< std::vector< Real > > projectedVectors_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
ext::shared_ptr< YieldTermStructure > r
ext::shared_ptr< BlackVolTermStructure > v