v0.11.1
Classes | Namespaces | Functions
Tensor2_value.hpp File Reference
#include <ostream>

Go to the source code of this file.

Classes

class  FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 >
 

Namespaces

 FTensor
 JSON compatible output.
 

Functions

template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::ostream & FTensor::Tensor2_ostream_row (std::ostream &os, const FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t, const int &i)
 
template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::ostream & operator<< (std::ostream &os, const FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t)
 
template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::istream & FTensor::Tensor2_istream_row (std::istream &is, FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t, const int &i)
 
template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::istream & operator>> (std::istream &is, FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t)
 

Function Documentation

◆ operator<<()

template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::ostream& operator<< ( std::ostream &  os,
const FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &  t 
)

Definition at line 249 of file Tensor2_value.hpp.

252 {
253  os << '[';
254  for(int i = 0; i + 1 < Tensor_Dim0; ++i)
255  {
257  os << ',';
258  }
259  if(Tensor_Dim0 > 0)
260  {
261  FTensor::Tensor2_ostream_row(os, t, Tensor_Dim0 - 1);
262  }
263  os << ']';
264  return os;
265 }
FTensor::Index< 'i', 3 > i
std::ostream & Tensor2_ostream_row(std::ostream &os, const FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t, const int &i)

◆ operator>>()

template<class T , int Tensor_Dim0, int Tensor_Dim1>
std::istream& operator>> ( std::istream &  is,
FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &  t 
)

Definition at line 292 of file Tensor2_value.hpp.

293 {
294  char c;
295  is >> c;
296  for(int i = 0; i + 1 < Tensor_Dim0; ++i)
297  {
299  is >> c;
300  }
301  if(Tensor_Dim0 > 0)
302  {
303  FTensor::Tensor2_istream_row(is, t, Tensor_Dim0 - 1);
304  }
305  is >> c;
306  return is;
307 }
std::istream & Tensor2_istream_row(std::istream &is, FTensor::Tensor2< T, Tensor_Dim0, Tensor_Dim1 > &t, const int &i)