File kernel/src/utils/SiconosAlgebra/ioVector.hpp

Go to the source code of this file

input/output for SiconosVector

namespace ioVector

Typedefs

typedef std::ios_base::openmode openmode

Functions

bool read(const std::string &fileName, SiconosVector &m, const openmode &mode = ASCII_IN, int precision = 15, const std::string &inputType = "python", const std::ios::fmtflags &flags = std::cin.flags())

Read a SiconosVector from a file.

Return
bool true if read ok, else false …
Parameters
  • fileName: the file containing the vector
  • m: the SiconosVector to be filled
  • mode: ios_base::openmode, mode for reading (like ios::in|ios:binary …) default = ascii
  • precision: value for float output. Default = 15.
  • inputType: (see outputType in write function)
  • flags: for reading

bool write(const std::string &fileName, const SiconosVector &m, const openmode &mode = ASCII_OUT, int precision = 15, const std::string &outputType = "python", const std::ios_base::fmtflags &flags = std::cout.flags())

Write a SiconosVector to a file.

Return
bool true if read ok, else false …
Parameters
  • fileName: output file name
  • mode: ios_base::openmode, mode for writing (like ios::out|ios:binary …) default = ascii
  • flags:
  • m: the SiconosVector to be written
  • precision: value for float output. Default = 15.
  • outputType: output format, choose between
    • ”boost”: row
    • ”python” (default): row a0 a1 a2 …
    • ”noDim”: a0 a1 a2 … Reading input format is the one corresponding to “python”.
  • flags:

Variables

const openmode ASCII_IN = std::ios::in

Format to read ascii data.

const openmode ASCII_OUT = std::ios::out

Format to write ascii data.

const openmode BINARY_IN = std::ios::in|std::ios::binary

Format to read binary data.

const openmode BINARY_OUT = std::ios::out|std::ios::binary

Format to write binary data.