Eigen 输出格式
来源:互联网 发布:云桌面软件 编辑:程序博客网 时间:2024/05/29 09:46
Eigen::IOFormat Class Reference
Detailed Description
Stores a set of parameters controlling the way matrices are printed.
List of available parameters:
- precision number of digits for floating point values, or one of the special constants
StreamPrecision
andFullPrecision
. The default is the special valueStreamPrecision
which means to use the stream's own precision setting, as set for instance usingcout.precision(3)
. The other special valueFullPrecision
means that the number of digits will be computed to match the full precision of each floating-point type.精度 - flags an OR-ed combination of flags, the default value is 0, the only currently available flag is
DontAlignCols
which allows to disable the alignment of columns, resulting in faster code.设置标号 - coeffSeparator string printed between two coefficients of the same row同一行两个数的分隔符
- rowSeparator string printed between two rows 两行之间的分隔符
- rowPrefix string printed at the beginning of each row每一行开头符号
- rowSuffix string printed at the end of each row每一行结束符号
- matPrefix string printed at the beginning of the matrix矩阵开始时符号
- matSuffix string printed at the end of the matrix矩阵结束时符号
Example:
std::string sep = "\n----------------------------------------\n";
Matrix3d m1;
m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9;
IOFormat CommaInitFmt(StreamPrecision, DontAlignCols,", ",", ","", "", " << ", ";");
IOFormat CleanFmt(4, 0,", ","\n","[", "]");
IOFormat OctaveFmt(StreamPrecision, 0,", ",";\n","", "", "[", "]");
IOFormat HeavyFmt(FullPrecision, 0,", ",";\n","[", "]", "[", "]");
std::cout << m1 << sep;
std::cout << m1.format(CommaInitFmt) << sep;
std::cout << m1.format(CleanFmt) << sep;
std::cout << m1.format(OctaveFmt) << sep;
std::cout << m1.format(HeavyFmt) << sep;
Output:
1.11 2 3.33 4 5 6 7 8.89 9---------------------------------------- << 1.11, 2, 3.33, 4, 5, 6, 7, 8.89, 9;----------------------------------------[1.111, 2, 3.333][ 4, 5, 6][ 7, 8.889, 9]----------------------------------------[1.11, 2, 3.33; 4, 5, 6; 7, 8.89, 9]----------------------------------------[[1.111111, 2, 3.33333]; [ 4, 5, 6]; [ 7, 8.888888, 9]]----------------------------------------
阅读全文
0 0
- Eigen 输出格式
- Eigen sparse 基本操作:构造 & 输出
- Eigen
- Eigen
- 输出格式
- 格式输出
- 输出格式
- 输出格式
- 输出格式
- 输出格式
- 输出格式
- 输出格式
- 输出格式
- 数据输出控制输出格式
- 【Eigen】VS2012配置Eigen
- 关于输出日期格式
- 输出固定的格式
- asp输出excel格式
- 6、ICMP:Internet控制报文协议
- 文件浏览器_数码相框项目总结 (上)
- HDU1792(公式)
- UILabel,UITextField,UIButton,UIimageView
- [DFS] HOJ 1797 Red and Black
- Eigen 输出格式
- Linux 的字符串截取很有用:有八种方法。
- 汇编中调用printf
- Python---4.文件读写
- 百家讲坛 大风歌
- 设计模式2-工厂模式
- fork没有返回2次,它只返回1次
- 机器学习常见模型分析与比较
- 数学公式归纳积累