ChemicalVector.hpp
45 using ChemicalVectorConstRef = ChemicalVectorBase<VectorConstRef,VectorConstRef,VectorConstRef,MatrixConstRef>;
84 : ChemicalVectorBase(constants(nrows, val), zeros(nrows), zeros(nrows), zeros(nrows, nspecies)) {}
311 auto operator[](Index irow) const -> ChemicalScalarBase<decltype(val[irow]), decltype(ddn.row(irow))>
321 return {rowsmap(val, irow, nrows), rowsmap(ddT, irow, nrows), rowsmap(ddP, irow, nrows), rowsmap(ddn, irow, nrows)};
329 return {rowsmap(val, irow, nrows), rowsmap(ddT, irow, nrows), rowsmap(ddP, irow, nrows), rowsmap(ddn, irow, nrows)};
339 return {rowsmap(val, irow, nrows), rowsmap(ddT, irow, nrows), rowsmap(ddP, irow, nrows), blockmap(ddn, irow, icol, nrows, ncols)};
349 return {rowsmap(val, irow, nrows), rowsmap(ddT, irow, nrows), rowsmap(ddP, irow, nrows), blockmap(ddn, irow, icol, nrows, ncols)};
361 auto zeros(const ChemicalVectorBase<V,T,P,N>& v) -> ChemicalVectorBase<decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0,0))>
369 auto ones(const ChemicalVectorBase<V,T,P,N>& v) -> ChemicalVectorBase<decltype(ones(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0,0))>
376 class Composition : public ChemicalVectorBase<VectorConstRef, decltype(zeros(0)), decltype(zeros(0)), decltype(identity(0,0))>
380 using Base = ChemicalVectorBase<VectorConstRef, decltype(zeros(0)), decltype(zeros(0)), decltype(identity(0,0))>;
383 Composition(VectorConstRef n) : Base(n, zeros(n.rows()), zeros(n.rows()), identity(n.rows(), n.rows())) {}
386 auto operator[](Index irow) const -> ChemicalScalarBase<double, decltype(unitrow(val.size(), irow))>
406 auto operator-(const ChemicalVectorBase<V,T,P,N>& r) -> ChemicalVectorBase<decltype(-r.val), decltype(-r.ddT), decltype(-r.ddP), decltype(-r.ddn)>
411 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
412 auto operator+(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> ChemicalVectorBase<decltype(l.val + r.val), decltype(l.ddT + r.ddT), decltype(l.ddP + r.ddP), decltype(l.ddn + r.ddn)>
417 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR>
418 auto operator+(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ChemicalVectorBase<decltype(l.val + r.val), decltype(l.ddT + r.ddT), decltype(l.ddP + r.ddP), decltype(l.ddn)>
423 template<typename VL, typename TL, typename PL, typename VR, typename TR, typename PR, typename NR>
424 auto operator+(const ThermoVectorBase<VL,TL,PL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> decltype(r + l)
430 auto operator+(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoScalarBase<VR>& r) -> ChemicalVectorBase<decltype(l.val + r.val*ones(l.size())), decltype(l.ddT + r.ddT*ones(l.size())), decltype(l.ddP + r.ddP*ones(l.size())), decltype(l.ddn)>
432 return {l.val + r.val*ones(l.size()), l.ddT + r.ddT*ones(l.size()), l.ddP + r.ddP*ones(l.size()), l.ddn};
436 auto operator+(const ThermoScalarBase<VL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> decltype(r + l)
442 auto operator+(const ChemicalVectorBase<V,T,P,N>& l, const Eigen::MatrixBase<Derived>& r) -> ChemicalVectorBase<decltype(l.val + r),T,P,N>
448 auto operator+(const Eigen::MatrixBase<Derived>& l, const ChemicalVectorBase<V,T,P,N>& r) -> decltype(r + l)
453 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
454 auto operator-(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> ChemicalVectorBase<decltype(l.val - r.val), decltype(l.ddT - r.ddT), decltype(l.ddP - r.ddP), decltype(l.ddn - r.ddn)>
459 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR>
460 auto operator-(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ChemicalVectorBase<decltype(l.val - r.val), decltype(l.ddT - r.ddT), decltype(l.ddP - r.ddP), decltype(l.ddn)>
465 template<typename VL, typename TL, typename PL, typename VR, typename TR, typename PR, typename NR>
466 auto operator-(const ThermoVectorBase<VL,TL,PL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> decltype(-(r - l))
472 auto operator-(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoScalarBase<VR>& r) -> ChemicalVectorBase<decltype(l.val - r.val*ones(l.size())), decltype(l.ddT - r.ddT*ones(l.size())), decltype(l.ddP - r.ddP*ones(l.size())), decltype(l.ddn)>
474 return {l.val - r.val*ones(l.size()), l.ddT - r.ddT*ones(l.size()), l.ddP - r.ddP*ones(l.size()), l.ddn};
478 auto operator-(const ThermoScalarBase<VL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> decltype(r + l)
484 auto operator-(const ChemicalVectorBase<V,T,P,N>& l, const Eigen::MatrixBase<Derived>& r) -> ChemicalVectorBase<decltype(l.val - r),T,P,N>
490 auto operator-(const Eigen::MatrixBase<Derived>& l, const ChemicalVectorBase<V,T,P,N>& r) -> decltype(-(r - l))
496 auto operator*(double l, const ChemicalVectorBase<V,T,P,N>& r) -> ChemicalVectorBase<decltype(l * r.val), decltype(l * r.ddT), decltype(l * r.ddP), decltype(l * r.ddn)>
508 auto operator*(const ThermoScalarBase<VL>& l, const ChemicalVectorBase<VR,T,P,N>& r) -> ChemicalVectorBase<decltype(l.val * r.val), decltype(l.val * r.ddT + l.ddT * r.val), decltype(l.val * r.ddP + l.ddP * r.val), decltype(l.val * r.ddn)>
510 return {l.val * r.val, l.val * r.ddT + l.ddT * r.val, l.val * r.ddP + l.ddP * r.val, l.val * r.ddn};
514 auto operator*(const ChemicalVectorBase<VL,T,P,N>& l, const ThermoScalarBase<VR>& r) -> decltype(r * l)
520 auto operator*(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalScalarBase<VR,NR>& r) -> ChemicalVectorBase<decltype(l.val * r.val), decltype(l.val * r.ddT + l.ddT * r.val), decltype(l.val * r.ddP + l.ddP * r.val), decltype(l.val * r.ddn + l.ddn * r.val)>
522 return {l.val * r.val, l.val * r.ddT + l.ddT * r.val, l.val * r.ddP + l.ddP * r.val, l.val * r.ddn + l.ddn * r.val};
526 auto operator*(const ChemicalScalarBase<VL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> decltype(r * l)
531 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
532 auto operator%(const ChemicalVectorBase<VL, TL, PL, NL>& l, const ChemicalVectorBase<VR, TR, PR, NR>& r) -> ChemicalVectorBase<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), decltype(diag(l.val) * r.ddn + diag(r.val) * l.ddn)>
540 template<typename VL, typename TL, typename PL, typename VR, typename TR, typename PR, typename NR>
541 auto operator%(const ThermoVectorBase<VL, TL, PL>& l, const ChemicalVectorBase<VR, TR, PR, NR>& r) -> ChemicalVectorBase<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), decltype(diag(l.val) * r.ddn)>
550 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR>
551 auto operator%(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> decltype(r % l)
557 auto operator%(const Eigen::MatrixBase<Derived>& l, const ChemicalVectorBase<V,T,P,N>& r) -> ChemicalVectorBase<decltype(diag(l) * r.val), decltype(diag(l) * r.ddT), decltype(diag(l) * r.ddP), decltype(diag(l) * r.ddn)>
563 auto operator%(const ChemicalVectorBase<VL,TL,PL,NL>& l, const Eigen::MatrixBase<Derived>& r) -> decltype(r % l)
568 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
569 auto operator/(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> ChemicalVector
578 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
579 auto operator/(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ThermoVectorBase<VR,TR,PR>& r) -> ChemicalVector
589 auto operator/(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalScalarBase<VR,NR>& r) -> ChemicalVector
599 auto operator/(const ChemicalVectorBase<VL,T,P,N>& l, const ThermoScalarBase<VR>& r) -> ChemicalVectorBase<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)), decltype(double() * (l.ddn * r.val))>
614 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
615 auto operator<(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
620 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
621 auto operator<=(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
626 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
627 auto operator>(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
632 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
633 auto operator>=(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
638 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
639 auto operator==(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
644 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
645 auto operator!=(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> bool
652 auto row(ChemicalVectorBase<V,T,P,N>& vec, Index irow) -> ChemicalScalarBase<decltype(vec.val[irow]), decltype(vec.ddn.row(irow))>
659 auto row(const ChemicalVectorBase<V,T,P,N>& vec, Index irow) -> ChemicalScalarBase<decltype(vec.val[irow]), decltype(vec.ddn.row(irow))>
666 auto row(ChemicalVectorBase<V,T,P,N>& vec, Index irow, Index icol, Index ncols) -> ChemicalScalarBase<decltype(vec.val[irow]), decltype(vec.ddn.row(irow).segment(icol, ncols))>
673 auto row(const ChemicalVectorBase<V,T,P,N>& vec, Index irow, Index icol, Index ncols) -> ChemicalScalarBase<decltype(vec.val[irow]), decltype(vec.ddn.row(irow).segment(icol, ncols))>
680 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))>
682 return {rows(vec.val, irow, nrows), rows(vec.ddT, irow, nrows), rows(vec.ddP, irow, nrows), rows(vec.ddn, irow, nrows)};
687 auto rows(const 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))>
689 return {rows(vec.val, irow, nrows), rows(vec.ddT, irow, nrows), rows(vec.ddP, irow, nrows), rows(vec.ddn, irow, nrows)};
694 auto rows(ChemicalVectorBase<V,T,P,N>& vec, Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorBase<decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(block(vec.ddn, irow, icol, nrows, ncols))>
696 return {rows(vec.val, irow, nrows), rows(vec.ddT, irow, nrows), rows(vec.ddP, irow, nrows), block(vec.ddn, irow, icol, nrows, ncols)};
701 auto rows(const ChemicalVectorBase<V,T,P,N>& vec, Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorBase<decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(block(vec.ddn, irow, icol, nrows, ncols))>
703 return {rows(vec.val, irow, nrows), rows(vec.ddT, irow, nrows), rows(vec.ddP, irow, nrows), block(vec.ddn, irow, icol, nrows, ncols)};
708 auto rows(ChemicalVectorBase<V,T,P,N>& vec, const Indices& irows) -> ChemicalVectorBase<decltype(rows(vec.val, irows)), decltype(rows(vec.ddT, irows)), decltype(rows(vec.ddP, irows)), decltype(rows(vec.ddn, irows))>
710 return {rows(vec.val, irows), rows(vec.ddT, irows), rows(vec.ddP, irows), rows(vec.ddn, irows)};
715 auto rows(const ChemicalVectorBase<V,T,P,N>& vec, const Indices& irows) -> ChemicalVectorBase<decltype(rows(vec.val, irows)), decltype(rows(vec.ddT, irows)), decltype(rows(vec.ddP, irows)), decltype(rows(vec.ddn, irows))>
717 return {rows(vec.val, irows), rows(vec.ddT, irows), rows(vec.ddP, irows), rows(vec.ddn, irows)};
722 auto rows(ChemicalVectorBase<V,T,P,N>& vec, const Indices& irows, const Indices& icols) -> ChemicalVectorBase<decltype(rows(vec.val, irows)), decltype(rows(vec.ddT, irows)), decltype(rows(vec.ddP, irows)), decltype(submatrix(vec.ddn, irows, icols))>
724 return {rows(vec.val, irows), rows(vec.ddT, irows), rows(vec.ddP, irows), submatrix(vec.ddn, irows, icols)};
729 auto rows(const ChemicalVectorBase<V,T,P,N>& vec, const Indices& irows, const Indices& icols) -> ChemicalVectorBase<decltype(rows(vec.val, irows)), decltype(rows(vec.ddT, irows)), decltype(rows(vec.ddP, irows)), decltype(submatrix(vec.ddn, irows, icols))>
731 return {rows(vec.val, irows), rows(vec.ddT, irows), rows(vec.ddP, irows), submatrix(vec.ddn, irows, icols)};
793 auto sum(const ChemicalVectorBase<V, T, P, N>& r) -> ChemicalScalarBase<double, decltype(r.ddn.colwise().sum())>
798 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
799 auto dot(const ChemicalVectorBase<VL,TL,PL,NL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> ChemicalScalarBase<double, decltype(tr(l.val) * r.ddn + tr(r.val) * l.ddn)>
801 return {tr(l.val) * r.val, tr(l.val) * r.ddT + tr(r.val) * l.ddT, tr(l.val) * r.ddP + tr(r.val) * l.ddP, tr(l.val) * r.ddn + tr(r.val) * l.ddn};
804 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
805 auto dot(const ThermoVectorBase<VL,TL,PL>& l, const ChemicalVectorBase<VR,TR,PR,NR>& r) -> ChemicalScalarBase<double, decltype(tr(l.val) * r.ddn)>
807 return {tr(l.val) * r.val, tr(l.val) * r.ddT + tr(r.val) * l.ddT, tr(l.val) * r.ddP + tr(r.val) * l.ddP, tr(l.val) * r.ddn};
810 template<typename VL, typename TL, typename PL, typename NL, typename VR, typename TR, typename PR, typename NR>
811 auto dot(const ChemicalVectorBase<VR,TR,PR,NR>& l, const ThermoVectorBase<VL,TL,PL>& r) -> decltype(dot(r, l))
817 auto dot(const Eigen::MatrixBase<Derived>& l, const ChemicalVectorBase<V,T,P,N>& r) -> ChemicalScalarBase<double, decltype(tr(l) * r.ddn)>
auto view(Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorRef
Return a view of an interval of the ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:337
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
ChemicalVectorBase(Index nrows, Index nspecies, double val)
Construct a ChemicalVectorBase instance with given number of rows and species, and a constant value.
Definition: ChemicalVector.hpp:83
auto operator=(const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
Assign another ChemicalVectorBase instance to this.
Definition: ChemicalVector.hpp:159
auto operator-=(const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
Assign-subtraction of a ThermoScalarBase instance to this.
Definition: ChemicalVector.hpp:261
auto size() const -> Index
Return the number of rows in this ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:105
auto fill(const ThermoScalarBase< VR > &other) -> void
Assign a ThermoScalarBase instance to this.
Definition: ChemicalVector.hpp:140
auto operator=(double other) -> ChemicalVectorBase &
Assign a scalar to this.
Definition: ChemicalVector.hpp:191
A template base class to represent a chemical scalar and its partial derivatives.
Definition: ChemicalScalar.hpp:49
V val
The value of the chemical scalar.
Definition: ChemicalScalar.hpp:52
auto submatrix(Eigen::MatrixBase< Derived > &mat, const Indices &irows, const Indices &icols) -> decltype(mat(irows, icols))
Return a view of some rows and columns of a matrix.
Definition: Matrix.hxx:155
ChemicalVectorBase(ChemicalVectorBase< VR, TR, PR, NR > &other)
Construct a ChemicalVectorBase instance from another.
Definition: ChemicalVector.hpp:96
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
ChemicalVectorBase(const ChemicalVectorBase< VR, TR, PR, NR > &other)
Construct a ChemicalVectorBase instance from another.
Definition: ChemicalVector.hpp:101
auto operator*=(double other) -> ChemicalVectorBase &
Assign-multiplication of a scalar to this.
Definition: ChemicalVector.hpp:288
auto operator/=(double other) -> ChemicalVectorBase &
Assign-division of a scalar to this.
Definition: ChemicalVector.hpp:298
auto operator+=(const ThermoVectorBase< VR, TR, PR > &other) -> ChemicalVectorBase &
Assign-addition of a ThermoVectorBase instance to this.
Definition: ChemicalVector.hpp:213
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto operator-=(const ThermoVectorBase< VR, TR, PR > &other) -> ChemicalVectorBase &
Assign-subtraction of a ThermoVectorBase instance to this.
Definition: ChemicalVector.hpp:251
auto identity(Index rows, Index cols) -> decltype(Matrix::Identity(rows, cols))
Return an expression of an identity matrix.
Definition: Matrix.hxx:77
A type that describes temperature in units of K.
Definition: ChemicalVector.hpp:377
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
ChemicalVectorBase(const V &val, const T &ddT, const P &ddP, const N &ddn)
Construct a ChemicalVectorBase instance with given values and derivatives.
Definition: ChemicalVector.hpp:91
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 fill(const ChemicalScalarBase< VR, NR > &other) -> void
Assign a ChemicalScalarBase instance to this.
Definition: ChemicalVector.hpp:130
auto resize(Index nrows, Index nspecies) -> void
Resize this ChemicalVectorBase instance with new number of rows and number of species.
Definition: ChemicalVector.hpp:113
auto blockmap(Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &mat, Index row, Index col, Index nrows, Index ncols) -> Eigen::Map< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >, Eigen::Unaligned, Eigen::Stride< Rows, Cols >>
Return a block mapped view of a matrix.
Definition: Matrix.hpp:240
auto operator-=(const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
Assign-subtraction of a ChemicalVectorBase instance to this.
Definition: ChemicalVector.hpp:240
N ddn
The matrix of partial mole derivatives of the chemical scalars.
Definition: ChemicalVector.hpp:63
auto operator+=(const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
Assign-addition of a ChemicalVectorBase instance to this.
Definition: ChemicalVector.hpp:202
auto operator*=(const ChemicalVectorBase< VR, TR, PR, NR > &other) -> ChemicalVectorBase &
Assign-multiplication of a ChemicalVectorBase instance to this.
Definition: ChemicalVector.hpp:278
auto operator+=(double other) -> ChemicalVectorBase &
Assign-addition of a scalar to this.
Definition: ChemicalVector.hpp:232
T ddT
The vector of partial temperature derivatives of the chemical scalars.
Definition: ChemicalVector.hpp:57
auto operator=(const ChemicalScalarBase< VR, NR > &other) -> ChemicalVectorBase &
Assign a ChemicalScalarBase instance to this.
Definition: ChemicalVector.hpp:170
auto operator[](Index irow) -> ChemicalScalarBase< decltype(val[irow]), decltype(ddn.row(irow))>
Return a ChemicalScalarBase with reference to the chemical scalar in a given row.
Definition: ChemicalVector.hpp:305
ChemicalVectorBase(Index nspecies)
Construct a ChemicalVectorBase instance with number of rows equal to given number of species.
Definition: ChemicalVector.hpp:70
ChemicalVectorBase()
Construct a default ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:66
Composition(VectorConstRef n)
Construct a Composition instance with given composition vector.
Definition: ChemicalVector.hpp:383
P ddP
The vector of partial pressure derivatives of the chemical scalars.
Definition: ChemicalVector.hpp:60
auto fill(double value) -> void
Assign a scalarsto this.
Definition: ChemicalVector.hpp:149
V val
The vector of chemical scalars.
Definition: ChemicalVector.hpp:54
auto resize(Index nspecies) -> void
Resize this ChemicalVectorBase instance with number of rows equal the number of species.
Definition: ChemicalVector.hpp:123
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
auto operator-=(double other) -> ChemicalVectorBase &
Assign-subtraction of a scalar to this.
Definition: ChemicalVector.hpp:270
auto view(Index irow, Index nrows) const -> ChemicalVectorConstRef
Return a view of an interval of the ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:327
auto view(Index irow, Index nrows) -> ChemicalVectorRef
Return a view of an interval of the ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:319
A template base class to represent a thermodynamic scalar and its partial derivatives.
Definition: ThermoScalar.hpp:45
auto operator[](Index irow) const -> ChemicalScalarBase< double, decltype(unitrow(val.size(), irow))>
Return a ChemicalScalarBase with const reference to the chemical scalar in a given row.
Definition: ChemicalVector.hpp:386
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
ChemicalVectorBase< Vector, Vector, Vector, Matrix > ChemicalVector
A type that represents a vector of chemical properties and their derivatives.
Definition: ChemicalVector.hpp:39
auto tr(Eigen::MatrixBase< Derived > &mat) -> decltype(mat.transpose())
Return the transpose of the matrix.
Definition: Matrix.hxx:167
auto operator=(const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
Assign a ThermoScalarBase instance to this.
Definition: ChemicalVector.hpp:181
auto operator+=(const ThermoScalarBase< VR > &other) -> ChemicalVectorBase &
Assign-addition of a ThermoScalarBase instance to this.
Definition: ChemicalVector.hpp:223
auto operator[](Index irow) const -> ChemicalScalarBase< decltype(val[irow]), decltype(ddn.row(irow))>
Return a ChemicalScalarBase with const reference to the chemical scalar in a given row.
Definition: ChemicalVector.hpp:311
auto block(Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols))
Return a view of some rows and columns of a matrix.
Definition: Matrix.hxx:143
auto view(Index irow, Index icol, Index nrows, Index ncols) const -> ChemicalVectorConstRef
Return a view of an interval of the ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:347
Eigen::Ref< const Eigen::VectorXd > VectorConstRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:31
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
ChemicalVectorBase(Index nrows, Index nspecies)
Construct a ChemicalVectorBase instance with given number of rows and species.
Definition: ChemicalVector.hpp:76