17 template void copyBppToEigen (
const std::vector<ExtendedFloat>& bppVector, Eigen::RowVectorXd& eigenVector);
18 template void copyBppToEigen (
const std::vector<ExtendedFloat>& bppVector, Eigen::VectorXd& eigenVector);
35 return lhs.exponent_part() < rhs.exponent_part();
39 eigenVector.
float_part() = Eigen::MatrixXd::NullaryExpr(
static_cast<Eigen::Index
>(bppVector[0].rows()),
40 static_cast<Eigen::Index
>(bppVector.size()),
41 [&maxE, &bppVector](
int i,
int j){
42 return bppVector[(size_t)j].float_part()(i) * bpp::constexpr_power<double> (bpp::ExtendedFloat::radix, bppVector[(size_t)j].exponent_part () - maxE);
47 void copyBppToEigen (
const std::vector<Eigen::VectorXd>& bppVector, Eigen::MatrixXd& eigenMatrix)
50 const auto eigenRows =
static_cast<Eigen::Index
>(bppVector[0].rows());
51 const auto eigenCols =
static_cast<Eigen::Index
>(bppVector.size());
53 eigenMatrix.resize (eigenRows, eigenCols);
55 for (Eigen::Index j = 0; j < eigenCols; ++j)
57 for (Eigen::Index i = 0; i < eigenRows; ++i)
59 eigenMatrix (i, j) = bppVector[(std::size_t)j](i);
67 const auto eigenRows =
static_cast<Eigen::Index
>(bppMatrix.
getNumberOfRows ());
69 eigenMatrix.
resize (eigenRows, eigenCols);
71 for (Eigen::Index i = 0; i < eigenRows; ++i)
73 for (Eigen::Index j = 0; j < eigenCols; ++j)
75 eigenMatrix.
float_part() (i, j) = bppMatrix (
static_cast<std::size_t
>(i),
static_cast<std::size_t
>(j));
79 std::cerr <<
"=== copyBppToEigen(" <<
typeid(bppMatrix).name() <<
", " <<
typeid(eigenMatrix).name() <<
") ===" << std::endl;
80 std::cerr << &bppMatrix << std::endl;
81 std::cerr << eigenRows <<
"," << eigenCols << std::endl;
82 std::cerr << eigenMatrix << std::endl;
83 std::cerr <<
"=== end copyBppToEigen === " << std::endl;
89 const auto eigenRows =
static_cast<Eigen::Index
>(bppMatrix.
getNumberOfRows ());
91 eigenMatrix.resize (eigenRows, eigenCols);
93 for (Eigen::Index i = 0; i < eigenRows; ++i)
95 for (Eigen::Index j = 0; j < eigenCols; ++j)
97 eigenMatrix (i, j) = bppMatrix (
static_cast<std::size_t
>(i),
static_cast<std::size_t
>(j));
101 std::cerr <<
"copyBppToEigen(" <<
typeid(bppMatrix).name() <<
", " <<
typeid(eigenMatrix).name() <<
")" << std::endl;
102 std::cerr << &bppMatrix << std::endl;
103 std::cerr << eigenRows <<
"," << eigenCols << std::endl;
104 std::cerr << eigenMatrix << std::endl;
115 template void copyEigenToBpp(
const Eigen::MatrixXd& eigenMatrix, std::vector<std::vector<double>>& bppMatrix);
116 template void copyEigenToBpp(
const Eigen::MatrixXd& eigenMatrix, std::vector<std::vector<bpp::ExtendedFloat>>& bppMatrix);
120 const auto eigenRows =
static_cast<std::size_t
>(eigenMatrix.
rows());
121 const auto eigenCols =
static_cast<std::size_t
>(eigenMatrix.
cols());
123 bppMatrix.
resize (eigenRows, eigenCols);
124 for (
size_t i = 0; i < eigenRows; ++i)
126 for (
size_t j = 0; j < eigenCols; ++j)
128 bppMatrix(i, j) =
convert (eigenMatrix (
static_cast<Eigen::Index
>(i),
static_cast<Eigen::Index
>(j)));
155 std::size_t seed = 0;
178 "recreate called with dependencies, but node does not have dependencies");
183 template class ConstantZero<uint>;
184 template class ConstantZero<double>;
185 template class ConstantZero<char>;
186 template class ConstantZero<std::string>;
188 template class ConstantZero<Parameter>;
189 template class ConstantZero<TransitionFunction>;
191 template class ConstantZero<Eigen::VectorXd>;
192 template class ConstantZero<Eigen::RowVectorXd>;
193 template class ConstantZero<Eigen::MatrixXd>;
195 template class ConstantZero<ExtendedFloatVectorXd>;
196 template class ConstantZero<ExtendedFloatRowVectorXd>;
197 template class ConstantZero<ExtendedFloatMatrixXd>;
200 template class ConstantOne<uint>;
201 template class ConstantOne<double>;
202 template class ConstantOne<char>;
203 template class ConstantOne<std::string>;
205 template class ConstantOne<Parameter>;
206 template class ConstantOne<TransitionFunction>;
208 template class ConstantOne<Eigen::VectorXd>;
209 template class ConstantOne<Eigen::RowVectorXd>;
210 template class ConstantOne<Eigen::MatrixXd>;
212 template class ConstantOne<ExtendedFloatVectorXd>;
213 template class ConstantOne<ExtendedFloatRowVectorXd>;
214 template class ConstantOne<ExtendedFloatMatrixXd>;
217 template class Identity<double>;
218 template class Identity<ExtendedFloatMatrixXd>;
219 template class Identity<Eigen::MatrixXd>;
222 template class NumericConstant<uint>;
223 template class NumericConstant<double>;
224 template class NumericConstant<size_t>;
225 template class NumericConstant<std::string>;
227 template class NumericConstant<ExtendedFloatVectorXd>;
228 template class NumericConstant<ExtendedFloatRowVectorXd>;
229 template class NumericConstant<ExtendedFloatMatrixXd>;
231 NumericConstant<char>
NodeX(
'X');
233 template class NumericConstant<Eigen::VectorXd>;
234 template class NumericConstant<Eigen::RowVectorXd>;
235 template class NumericConstant<Eigen::MatrixXd>;
237 template class NumericMutable<uint>;
238 template class NumericMutable<double>;
240 template class NumericMutable<ExtendedFloatVectorXd>;
241 template class NumericMutable<ExtendedFloatRowVectorXd>;
242 template class NumericMutable<ExtendedFloatMatrixXd>;
244 template class NumericMutable<Eigen::VectorXd>;
245 template class NumericMutable<Eigen::RowVectorXd>;
246 template class NumericMutable<Eigen::MatrixXd>;
248 template class Convert<double, double>;
250 template class Convert<ExtendedFloatVectorXd, double>;
251 template class Convert<ExtendedFloatVectorXd, ExtendedFloatVectorXd>;
252 template class Convert<ExtendedFloatVectorXd, Eigen::VectorXd>;
253 template class Convert<ExtendedFloatVectorXd, Eigen::VectorXi>;
254 template class Convert<ExtendedFloatVectorXd, Transposed<ExtendedFloatRowVectorXd>>;
255 template class Convert<ExtendedFloatVectorXd, Transposed<Eigen::RowVectorXd>>;
257 template class Convert<Eigen::VectorXd, ExtendedFloatVectorXd>;
259 template class Convert<ExtendedFloatRowVectorXd, double>;
260 template class Convert<ExtendedFloatRowVectorXd, ExtendedFloatRowVectorXd>;
261 template class Convert<ExtendedFloatRowVectorXd, Eigen::RowVectorXd>;
262 template class Convert<ExtendedFloatRowVectorXd, Eigen::RowVectorXi>;
263 template class Convert<ExtendedFloatRowVectorXd, Transposed<ExtendedFloatVectorXd>>;
264 template class Convert<ExtendedFloatRowVectorXd, Transposed<Eigen::VectorXd>>;
266 template class Convert<ExtendedFloatMatrixXd, double>;
267 template class Convert<ExtendedFloatMatrixXd, ExtendedFloatMatrixXd>;
268 template class Convert<ExtendedFloatMatrixXd, Eigen::MatrixXd>;
269 template class Convert<ExtendedFloatMatrixXd, Transposed<ExtendedFloatMatrixXd>>;
270 template class Convert<ExtendedFloatMatrixXd, Transposed<Eigen::MatrixXd>>;
272 template class Convert<Eigen::VectorXd, double>;
273 template class Convert<Eigen::VectorXd, Eigen::VectorXd>;
274 template class Convert<Eigen::VectorXd, Eigen::VectorXi>;
275 template class Convert<Eigen::VectorXd, Transposed<Eigen::RowVectorXd>>;
277 template class Convert<Eigen::RowVectorXd, double>;
278 template class Convert<Eigen::RowVectorXd, Eigen::RowVectorXd>;
279 template class Convert<Eigen::RowVectorXd, Eigen::RowVectorXi>;
280 template class Convert<Eigen::RowVectorXd, Transposed<Eigen::VectorXd>>;
282 template class Convert<Eigen::MatrixXd, double>;
283 template class Convert<Eigen::MatrixXd, Eigen::MatrixXd>;
284 template class Convert<Eigen::MatrixXd, Transposed<Eigen::MatrixXd>>;
virtual const ExtType & exponent_part() const
virtual const MatType & float_part() const
Eigen::Index cols() const
Eigen::Index rows() const
void resize(Eigen::Index rows, Eigen::Index cols)
virtual size_t getNumberOfColumns() const=0
virtual void resize(size_t nRows, size_t nCols)=0
virtual size_t getNumberOfRows() const=0
void checkDimensionIsSquare(const MatrixDimension &dim)
R convert(const F &from, const Dimension< R > &)
Defines the basic types of data flow nodes.
std::size_t hash(const MatrixDimension &dim)
std::vector< double > Vdouble
NumericConstant< char > NodeX('X')
template void copyEigenToBpp(const RowLik &eigenVector, std::vector< ExtendedFloat > &bppVector)
void checkRecreateWithoutDependencies(const std::type_info &contextNodeType, const NodeRefVec &deps)
std::vector< NodeRef > NodeRefVec
Alias for a dependency vector (of NodeRef).
std::string prettyTypeName(const std::type_info &ti)
Debug: return a readable name for a C++ type descriptor (from typeid operator).
std::string to_string(const MatrixDimension &dim)
void combineHash(std::size_t &seed, const T &t)
Combine hashable value to a hash, from Boost library.
void copyBppToEigen(const bpp::Matrix< double > &bppMatrix, Eigen::MatrixXd &eigenMatrix)
Basic matrix dimension type.
Empty type representing no dimensions.