Ejemplo n.º 1
0
inline _4dArray<T> &_4dArray<T>::operator+=(const _4dArray<T> &other) {
  if ((this->extent(0) != other.extent(0)) ||
      (this->extent(1) != other.extent(1)) ||
      (this->extent(2) != other.extent(2)) ||
      (this->extent(3) != other.extent(3)))
    std::runtime_error("_4dArray<T> operator+=: Array sizes don't agree.");
  for (size_t i = 0; i < this->extent(3); ++i)
    for (size_t j = 0; j < this->extent(2); ++j)
      for (size_t k = 0; k < this->extent(1); ++k)
        for (size_t l = 0; l < this->extent(0); ++l)
          (*this)(l, k, j, i) += other(l, k, j, i);
  return *this;
}
Ejemplo n.º 2
0
 /** \brief Return number of shape functions. */
 int functionCount() const {
     return std::max<int>(values.extent(1), derivatives.extent(2));
 }
Ejemplo n.º 3
0
 /** \brief Return number of points at which the shape functions have been
  *  calculated. */
 int pointCount() const {
     return std::max<int>(values.extent(2), derivatives.extent(3));
 }
Ejemplo n.º 4
0
 /** \brief Return number of components of shape functions. */
 int componentCount() const {
     return std::max<int>(values.extent(0), derivatives.extent(0));
 }