CAPD DynSys Library
5.2.0
|
#include <capd/basicalg/TexWriter.h>
Public Types | |
enum | FloatStyle { FloatSci, FloatFix, FloatFix2, FloatTxt } |
enum | ImStyle { ImExplicit, ImSymbolii } |
enum | ExponentStyle { CStyle, TexStyle } |
enum | VectorStyle { HorizontalVector, CAPDStyle, VerticalVector } |
enum | EquationStyle { GlobalEquationStyle =-1, NoEquation, InlineEquation, DisplayEquation } |
enum | PlusSymbolStyle { StandardPlus, ImplicitPlus, NoPlus } |
Public Member Functions | |
TexWriter (std::ostream &output) | |
template<typename T > | |
T | putDigits (std::deque< int > &container, int &sign, T number, int n, int precision) |
It parses number and puts its nDigits digits in container. More... | |
void | writeSciInterval (const std::deque< int > &dl, const std::deque< int > &dr, int p, int l_sign, int len) |
void | writeFixInterval (const std::deque< int > &dl, const std::deque< int > &dr, int p, int l_sign, int intDigits, int prec) |
void | writeTxtInterval (const std::deque< int > &dl, const std::deque< int > &dr, int p, int l_sign, int intDigits, int prec) |
template<typename IntervalType > | |
void | writeInterval (const IntervalType &intv) |
template<typename VectorType > | |
void | writeVector (const VectorType &x) |
int | precision () |
TexWriter & | precision (int newPrecision) |
TexWriter & | setFloatStyle (FloatStyle style) |
TexWriter & | setExponentStyle (ExponentStyle i) |
Sets style of a base. More... | |
TexWriter & | setBaseStyle (int i) |
Sets style of a base. i=0 C convention for exponents e.g 1.0e-5 i=1 TeX e.g. 1.0\cdot 10^{-5}. More... | |
TexWriter & | setISymbol (ImStyle i) |
Sets style of imaginary symbol i. More... | |
TexWriter & | setISymbol (int i) |
sets imaginary symbol i. More... | |
TexWriter & | setVectorStyle (const std::string &start, const std::string &end, const std::string &separator) |
sets vector style More... | |
TexWriter & | setVectorStyle (const VectorStyle &i) |
sets vector style. More... | |
TexWriter & | setVectorStyle (int i) |
sets vector style. More... | |
std::string | getEquationBeginSymbol (EquationStyle i) |
std::string | getEquationEndSymbol (EquationStyle i) |
TexWriter & | setEquationSymbol (EquationStyle i) |
TexWriter & | setEquationSymbol (int i) |
TexWriter & | setPlusSymbol (int i) |
template<typename T > | |
TexWriter & | write (const T &x, EquationStyle equationStyle=GlobalEquationStyle) |
void | writeDocumentHeader (std::string parameters="") |
void | writeDocumentFooter () |
Static Public Member Functions | |
static int | numberOfDigits (double n) |
template<typename Float > | |
static void | computeNumberOfDigitsForInterval (Float &l, Float &r, int prec, FloatStyle style, int &n, int &len, int &exponent) |
For given left and right end of interval and expected precision depending on style chosen it computes needed total number of digits, number of digits before decimal point. More... | |
Public Attributes | |
FloatStyle | floatStyle |
std::string | baseSymbol |
std::string | iSymbol |
std::string | vectorStartSymbol |
std::string | vectorEndSymbol |
std::string | vectorSeparator |
std::string | equationBeginSymbol |
std::string | equationEndSymbol |
std::string | plusSymbol |
Protected Attributes | |
std::ostream & | out |
Friends | |
template<typename T > | |
TexWriter & | operator<< (TexWriter &o, const T &x) |
TexWriter & | operator<< (TexWriter &o, std::ostream &(*fn)(std::ostream &)) |
|
inline |
|
static |
For given left and right end of interval and expected precision depending on style chosen it computes needed total number of digits, number of digits before decimal point.
Additionally for FloatSci style it returns common exponent and changes endpoints so that at least one of them is in the form 1.xxxxxx... (second can be 0.00xxxx)
|
inline |
|
inline |
|
inline |
T capd::TexWriter::putDigits | ( | std::deque< int > & | container, |
int & | sign, | ||
T | number, | ||
int | nDecDigits, | ||
int | nDigits | ||
) |
It parses number and puts its nDigits digits in container.
[out] | container | [out] container where digits will be stored |
[out] | sign | [out] returns sign of number |
[in] | number | [in] number to be parsed |
[in] | nDecDigits | [in] number of decimal digits (before decimal point) of a given number to be stored in container |
[in] | nDigits | [in] total number of digits to be stored in container |
Sets style of a base. i=0 C convention for exponents e.g 1.0e-5 i=1 TeX e.g. 1.0\cdot 10^{-5}.
|
inline |
|
inline |
Sets style of a base.
|
inline |
|
inline |
sets vector style
|
inline |
sets vector style.
sets vector style.
TexWriter & capd::TexWriter::write | ( | const T & | x, |
EquationStyle | equationStyle = GlobalEquationStyle |
||
) |
|
inline |
|
inline |
void capd::TexWriter::writeFixInterval | ( | const std::deque< int > & | dl, |
const std::deque< int > & | dr, | ||
int | p, | ||
int | l_sign, | ||
int | intDigits, | ||
int | prec | ||
) |
void capd::TexWriter::writeInterval | ( | const IntervalType & | intv | ) |
void capd::TexWriter::writeSciInterval | ( | const std::deque< int > & | dl, |
const std::deque< int > & | dr, | ||
int | p, | ||
int | l_sign, | ||
int | len | ||
) |
void capd::TexWriter::writeTxtInterval | ( | const std::deque< int > & | dl, |
const std::deque< int > & | dr, | ||
int | p, | ||
int | l_sign, | ||
int | intDigits, | ||
int | prec | ||
) |
void capd::TexWriter::writeVector | ( | const VectorType & | x | ) |
std::string capd::TexWriter::baseSymbol |
std::string capd::TexWriter::equationBeginSymbol |
std::string capd::TexWriter::equationEndSymbol |
FloatStyle capd::TexWriter::floatStyle |
std::string capd::TexWriter::iSymbol |
|
protected |
std::string capd::TexWriter::plusSymbol |
std::string capd::TexWriter::vectorEndSymbol |
std::string capd::TexWriter::vectorSeparator |
std::string capd::TexWriter::vectorStartSymbol |