ThermoVector.hpp
271 auto zeros(const ThermoVectorBase<V,T,P>& v) -> ThermoVectorBase<decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0))>
279 auto ones(const ThermoVectorBase<V,T,P>& v) -> ThermoVectorBase<decltype(ones(0)), decltype(zeros(0)), decltype(zeros(0))>
299 auto operator-(const ThermoVectorBase<V,T,P>& l) -> ThermoVectorBase<decltype(-l.val), decltype(-l.ddT), decltype(-l.ddP)>
305 auto operator+(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ThermoVectorBase<decltype(l.val + r.val), decltype(l.ddT + r.ddT), decltype(l.ddP + r.ddP)>
311 auto operator+(const ThermoVectorBase<V,T,P>& l, VectorConstRef r) -> ThermoVectorBase<decltype(l.val + r),T,P>
323 auto operator-(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ThermoVectorBase<decltype(l.val - r.val), decltype(l.ddT - r.ddT), decltype(l.ddP - r.ddP)>
329 auto operator-(const ThermoVectorBase<V,T,P>& l, VectorConstRef r) -> ThermoVectorBase<decltype(l.val - r),T,P>
341 auto operator*(double l, const ThermoVectorBase<V,T,P>& r) -> ThermoVectorBase<decltype(l * r.val), decltype(l * r.ddT), decltype(l * r.ddP)>
353 auto operator*(const ThermoScalarBase<VL>& l, const ThermoVectorBase<V,T,P>& r) -> ThermoVectorBase<decltype(l.val * r.val), decltype(l.val * r.ddT + l.ddT * r.val), decltype(l.val * r.ddP + l.ddP * r.val)>
359 auto operator*(const ThermoVectorBase<V,T,P>& l, const ThermoScalarBase<VR>& r) -> decltype(r * l)
365 auto operator%(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ThermoVectorBase<decltype(diag(l.val) * r.val), decltype(diag(l.val) * r.ddT + diag(r.val) * l.ddT), decltype(diag(l.val) * r.ddP + diag(r.val) * l.ddP)>
373 auto operator%(VectorConstRef l, const ThermoVectorBase<V,T,P>& r) -> ThermoVectorBase<decltype(diag(l) * r.val), decltype(diag(l) * r.ddT), decltype(diag(l) * r.ddP)>
387 auto operator/(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ThermoVector
396 auto operator/(const ThermoVectorBase<V,T,P>& l, const ThermoScalarBase<VR>& r) -> ThermoVectorBase<decltype(l.val/r.val), decltype(double() * (l.ddT * r.val - l.val * r.ddT)), decltype(double() * (l.ddP * r.val - l.val * r.ddP))>
399 return {l.val/r.val, tmp * (l.ddT * r.val - l.val * r.ddT), tmp * (l.ddP * r.val - l.val * r.ddP)};
409 auto operator<(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
415 auto operator<=(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
421 auto operator>(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
427 auto operator>=(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
433 auto operator==(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
439 auto operator!=(const ThermoVectorBase<VL,TL,PL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> bool
453 auto row(const ThermoVectorBase<V,T,P>& vec, Index irow) -> ThermoScalarBase<decltype(vec.val[irow])>
460 auto rows(ThermoVectorBase<V,T,P>& vec, Index irow, Index nrows) -> ThermoVectorBase<decltype(vec.val.segment(irow, nrows)), decltype(vec.ddT.segment(irow, nrows)), decltype(vec.ddP.segment(irow, nrows))>
462 return {vec.val.segment(irow, nrows), vec.ddT.segment(irow, nrows), vec.ddP.segment(irow, nrows)};
467 auto rows(const ThermoVectorBase<V,T,P>& vec, Index irow, Index nrows) -> ThermoVectorBase<decltype(vec.val.segment(irow, nrows)), decltype(vec.ddT.segment(irow, nrows)), decltype(vec.ddP.segment(irow, nrows))>
469 return {vec.val.segment(irow, nrows), vec.ddT.segment(irow, nrows), vec.ddP.segment(irow, nrows)};
474 auto rows(ThermoVectorBase<V,T,P>& vec, const Indices& irows) -> ThermoVectorBase<decltype(Reaktoro::rows(vec.val, irows)), decltype(Reaktoro::rows(vec.ddT, irows)), decltype(Reaktoro::rows(vec.ddP, irows))>
476 return {Reaktoro::rows(vec.val, irows), Reaktoro::rows(vec.ddT, irows), Reaktoro::rows(vec.ddP, irows)};
481 auto rows(const ThermoVectorBase<V,T,P>& vec, const Indices& irows) -> ThermoVectorBase<decltype(Reaktoro::rows(vec.val, irows)), decltype(Reaktoro::rows(vec.ddT, irows)), decltype(Reaktoro::rows(vec.ddP, irows))>
483 return {Reaktoro::rows(vec.val, irows), Reaktoro::rows(vec.ddT, irows), Reaktoro::rows(vec.ddP, irows)};
auto operator-=(double other) -> ThermoVectorBase &
Assign-subtraction of a scalar.
Definition: ThermoVector.hpp:202
auto rowsmap(Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &mat, Index row, Index nrows) -> Eigen::Map< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >, Eigen::Unaligned, Eigen::Stride< Rows, Cols >>
Return a mapped view of a sequence of rows of a matrix.
Definition: Matrix.hpp:266
auto operator-=(const ThermoScalarBase< VR > &other) -> ThermoVectorBase &
Assign-subtraction of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:193
auto view(Index irow, Index nrows) const -> ThermoVectorConstRef
Return a view of an interval of the ThermoVectorBase instance.
Definition: ThermoVector.hpp:257
auto operator*=(const ThermoVectorBase< VR, TR, PR > &other) -> ThermoVectorBase &
Assign-multiplication of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:210
auto view(Index irow, Index nrows) -> ThermoVectorRef
Return a view of an interval of the ThermoVectorBase instance.
Definition: ThermoVector.hpp:249
auto size() const -> Index
Return the number of rows in this ChemicalVectorBase instance.
Definition: ThermoVector.hpp:94
ThermoVectorBase< Vector, Vector, Vector > ThermoVector
A type that defines a vector of thermodynamic properties.
Definition: ScalarTypes.hpp:41
auto operator-=(const ThermoVectorBase< VR, TR, PR > &other) -> ThermoVectorBase &
Assign-subtraction of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:183
auto row(ChemicalVectorBase< V, T, P, N > &vec, Index irow) -> ChemicalScalarBase< decltype(vec.val[irow]), decltype(vec.ddn.row(irow))>
Return a ChemicalScalarBase with reference to the chemical scalar in a given row.
Definition: ChemicalVector.hpp:652
V val
The vector of values of the thermodynamic properties.
Definition: ThermoVector.hpp:51
auto operator+=(double scalar) -> ThermoVectorBase &
Assign-addition of a scalar.
Definition: ThermoVector.hpp:175
auto fill(double value) -> void
Assign a scalarsto this.
Definition: ThermoVector.hpp:118
ThermoVectorBase(Index nrows)
Construct a ThermoVectorBase instance with given number of rows.
Definition: ThermoVector.hpp:65
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto operator[](Index irow) const -> ThermoScalarBase< decltype(val[irow])>
Return a ChemicalScalarBase with const reference to the thermo scalar in a given row.
Definition: ThermoVector.hpp:241
auto zeros(const ChemicalVectorBase< V, T, P, N > &v) -> ChemicalVectorBase< decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0, 0))>
Return a ChemicalVectorBase expression representing zeros with same dimension of given vector.
Definition: ChemicalVector.hpp:361
ThermoVectorBase(const V &val, const T &ddT, const P &ddP)
Construct a ChemicalVectorBase instance with given values and derivatives.
Definition: ThermoVector.hpp:78
auto rows(ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index nrows) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(rows(vec.ddn, irow, nrows))>
Return a reference of a sequence of rows of this ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:680
auto resize(Index nrows) -> void
Resize this ChemicalVectorBase instance with new number of rows.
Definition: ThermoVector.hpp:101
auto operator=(double other) -> ThermoVectorBase &
Assign a scalar to this ThermoVectorBase instance.
Definition: ThermoVector.hpp:146
T ddT
The vector of partial temperature derivatives of the thermodynamic properties.
Definition: ThermoVector.hpp:54
ThermoVectorBase(Index nrows, double val)
Construct a ThermoVectorBase instance with given number of rows and value.
Definition: ThermoVector.hpp:71
ThermoVectorBase()
Construct a default ThermoVectorBase instance.
Definition: ThermoVector.hpp:60
auto fill(const ThermoScalarBase< VR > &other) -> void
Assign a ThermoScalarBase instance to this.
Definition: ThermoVector.hpp:110
auto operator+=(const ThermoScalarBase< VR > &other) -> ThermoVectorBase &
Assign-addition of a ThermoScalarBase instance.
Definition: ThermoVector.hpp:166
auto operator*=(double scalar) -> ThermoVectorBase &
Assign-multiplication of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:219
ThermoVectorBase(const ThermoVectorBase< VR, TR, PR > &other)
Construct a ChemicalVectorBase instance from another.
Definition: ThermoVector.hpp:89
auto operator=(const ThermoVectorBase< VR, TR, PR > &other) -> ThermoVectorBase &
Assign a ThermoVectorBase instance to this ThermoVectorBase instance.
Definition: ThermoVector.hpp:127
auto operator=(const ThermoScalarBase< VR > &other) -> ThermoVectorBase &
Assign a ThermoScalarBase instance to this ThermoVectorBase instance.
Definition: ThermoVector.hpp:137
auto operator+=(const ThermoVectorBase< VR, TR, PR > &other) -> ThermoVectorBase &
Assign-addition of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:156
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
A template base class to represent a thermodynamic scalar and its partial derivatives.
Definition: ThermoScalar.hpp:45
auto ones(const ChemicalVectorBase< V, T, P, N > &v) -> ChemicalVectorBase< decltype(ones(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0, 0))>
Return a ChemicalVectorBase expression representing ones with same dimension of given vector.
Definition: ChemicalVector.hpp:369
auto operator/=(double scalar) -> ThermoVectorBase &
Assign-division of a ThermoVectorBase instance.
Definition: ThermoVector.hpp:228
V val
The value of the thermodynamic property.
Definition: ThermoScalar.hpp:48
auto operator[](Index irow) -> ThermoScalarBase< decltype(val[irow])>
Return a ChemicalScalarBase with reference to the thermo scalar in a given row.
Definition: ThermoVector.hpp:235
Eigen::Ref< const Eigen::VectorXd > VectorConstRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:31
P ddP
The vector of partial pressure derivatives of the thermodynamic properties.
Definition: ThermoVector.hpp:57
ThermoVectorBase(ThermoVectorBase< VR, TR, PR > &other)
Construct a ChemicalVectorBase instance from another.
Definition: ThermoVector.hpp:83
auto diag(const Eigen::MatrixBase< Derived > &vec) -> decltype(vec.asDiagonal())
Return a diagonal matrix representation of a vector.
Definition: Matrix.hxx:185
A template base class to represent a vector of thermodynamic scalars and their partial derivatives.
Definition: ThermoVector.hpp:48