ganrac

package module
v0.0.0-...-d153b1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PF_EVAL_UNKNOWN = -1
	PF_EVAL_NO      = 0
	PF_EVAL_YES     = 1

	PROJ_McCallum = 0
	PROJ_HONG     = 1

	CAD_STAGE_INITED int8 = 0
	CAD_STAGE_PROJED int8 = 1
	CAD_STAGE_LIFTED int8 = 2
)
View Source
const (
	EVEN_NO   = 0x00
	EVEN_NG   = 0x01
	EVEN_LIN1 = 0x02 // 線形,ただし,主係数は定数
	EVEN_LIN2 = 0x04 // 線形で,主係数が変数
	EVEN_OK   = 0x08 // atom の因数分解した因子すべてが even 例:(x^2+1) * (x^4+3*x^2+1)
	EVEN_OKM  = 0x10 // atom.getPoly() が even 例:(x-1)*(x+1)
	EVEN_LIN  = EVEN_LIN1 | EVEN_LIN2
)
View Source
const (
	LT       OP = 0x1
	EQ       OP = 0x2
	GT       OP = 0x4
	LE       OP = LT | EQ
	GE       OP = GT | EQ
	NE       OP = GT | LT
	OP_TRUE  OP = GT | EQ | LT
	OP_FALSE OP = 0x0

	FTAG_TRUE  uint = 0x101
	FTAG_FALSE uint = 0x102
	FTAG_ATOM  uint = 0x103
	FTAG_AND   uint = 0x104
	FTAG_OR    uint = 0x105
	FTAG_ALL   uint = 0x106
	FTAG_EX    uint = 0x107
)
View Source
const (
	TAG_NONE = iota
	TAG_STR
	TAG_NUM
	TAG_POLY
	TAG_FOF
	TAG_LIST
	TAG_CAD

	FORMAT_TEX    = 'P'
	FORMAT_DUMP   = 'V'
	FORMAT_SRC    = 'S'
	FORMAT_QEPCAD = 'Q'
)
View Source
const (
	NTAG_NONE = iota
	NTAG_INT
	NTAG_RAT
	NTAG_BININT
	NTAG_INTERVAL
	NTAG_MOD
)
View Source
const (
	OX_COMMAND   int32 = 513 // 0x201
	OX_DATA      int32 = 514 // 0x202
	OX_SYNC_BALL int32 = 515 // ball to interrupt
	OX_NOTIFY    int32 = 516

	OX_DATA_WITH_SIZE              int32 = 521
	OX_DATA_ASIR_BINARY_EXPRESSION int32 = 522 /* This number should be changed*/
	OX_DATA_OPENMATH_XML           int32 = 523
	OX_DATA_OPENMATH_BINARY        int32 = 524
	OX_DATA_MP                     int32 = 525

	SM_popSerializedLocalObject int32 = 258
	SM_popCMO                   int32 = 262
	SM_popString                int32 = 263 /* result ==> string and send the string by CMO */

	SM_mathcap                                    int32 = 264
	SM_pops                                       int32 = 265
	SM_setName                                    int32 = 266
	SM_evalName                                   int32 = 267
	SM_executeStringByLocalParser                 int32 = 268
	SM_executeFunction                            int32 = 269
	SM_beginBlock                                 int32 = 270
	SM_endBlock                                   int32 = 271
	SM_shutdown                                   int32 = 272
	SM_setMathCap                                 int32 = 273
	SM_executeStringByLocalParserInBatchMode      int32 = 274
	SM_getsp                                      int32 = 275
	SM_dupErrors                                  int32 = 276
	SM_pushCMOtag                                 int32 = 277
	SM_executeFunctionAndPopCMO                   int32 = 278
	SM_executeFunctionAndPopSerializedLocalObject int32 = 279
	SM_executeFunctionWithOptionalArgument        int32 = 282

	SM_nop int32 = 300

	SM_control_kill                    int32 = 1024
	SM_control_to_debug_mode           int32 = 1025
	SM_control_exit_debug_mode         int32 = 1026
	SM_control_spawn_server            int32 = 1027
	SM_control_terminate_server        int32 = 1028
	SM_control_reset_connection_server int32 = 1029
	SM_control_reset_connection        int32 = 1030

	SM_PRIVATE int32 = 0x7fff0000 /*  2147418112  */

	LARGEID     int32 = 0x7f000000 /* 2130706432 */
	CMO_PRIVATE int32 = 0x7fff0000 /* 2147418112 */

	CMO_ERROR2  int32 = (LARGEID + 2)
	CMO_NULL    int32 = 1
	CMO_INT32   int32 = 2
	CMO_DATUM   int32 = 3
	CMO_STRING  int32 = 4
	CMO_MATHCAP int32 = 5
	CMO_LIST    int32 = 17

	CMO_ATTRIBUTE_LIST int32 = (LARGEID + 3)

	CMO_MONOMIAL32                 int32 = 19
	CMO_ZZ                         int32 = 20
	CMO_QQ                         int32 = 21
	CMO_ZERO                       int32 = 22
	CMO_DMS                        int32 = 23 /* Distributed monomial system */
	CMO_DMS_GENERIC                int32 = 24
	CMO_DMS_OF_N_VARIABLES         int32 = 25
	CMO_RING_BY_NAME               int32 = 26
	CMO_RECURSIVE_POLYNOMIAL       int32 = 27
	CMO_LIST_R                     int32 = 28
	CMO_INT32COEFF                 int32 = 30
	CMO_DISTRIBUTED_POLYNOMIAL     int32 = 31
	CMO_POLYNOMIAL_IN_ONE_VARIABLE int32 = 33
	CMO_RATIONAL                   int32 = 34
	CMO_COMPLEX                    int32 = 35

	CMO_64BIT_MACHINE_DOUBLE           int32 = 40
	CMO_ARRAY_OF_64BIT_MACHINE_DOUBLE  int32 = 41
	CMO_128BIT_MACHINE_DOUBLE          int32 = 42
	CMO_ARRAY_OF_128BIT_MACHINE_DOUBLE int32 = 43

	CMO_BIGFLOAT          int32 = 50
	CMO_IEEE_DOUBLE_FLOAT int32 = 51
	CMO_BIGFLOAT32        int32 = 52

	CMO_INDETERMINATE int32 = 60
	CMO_TREE          int32 = 61
	CMO_LAMBDA        int32 = 62 /* for function definition */

)

http://www.math.sci.kobe-u.ac.jp/OpenXM/Current/index-spec.html

View Source
const (
	QEALGO_VSLIN  = 0x0001
	QEALGO_VSQUAD = 0x0002

	QEALGO_EQLIN  = 0x0010
	QEALGO_EQQUAD = 0x0020

	QEALGO_NEQ = 0x0100 // 非等式制約QE

	QEALGO_SMPL_EVEN = 0x100000000
	QEALGO_SMPL_HOMO = 0x200000000
	QEALGO_SMPL_TRAN = 0x400000000
	QEALGO_SMPL_ROTA = 0x800000000
)
View Source
const (
	// pdq() の復帰
	SFC_PROJ_DEFINABLE   = 0
	SFC_PROJ_UNDEFINABLE = 1
	SFC_PROJ_UNDET       = 2
)
View Source
const KARATSUBA_DEG_MOD = 4

go test -bench BenchmarkModularMulPoly -run BenchmarkModularMulPoly -o prof/ganrac -count=N 3x20= 34.222 4x20= 30.380 5x20= 31.947

Variables

View Source
var CAD_NO_WO = errors.New("NOT well-oriented")

Functions

func GetColordFml

func GetColordFml() bool

func MaxPrec

func MaxPrec(x, y *Interval) uint

func SetColordFml

func SetColordFml(b bool)

Types

type Atom

type Atom struct {
	// contains filtered or unexported fields
}

func (*Atom) Deg

func (p *Atom) Deg(lv Level) int

func (*Atom) Equals

func (p *Atom) Equals(qq interface{}) bool

func (*Atom) FmlLess

func (p *Atom) FmlLess(qq Fof) bool

func (*Atom) Format

func (p *Atom) Format(b fmt.State, format rune)

func (*Atom) Indets

func (p *Atom) Indets(b []bool)

func (*Atom) IsQff

func (p *Atom) IsQff() bool

func (*Atom) IsQuantifier

func (p *Atom) IsQuantifier() bool

func (*Atom) Not

func (p *Atom) Not() Fof

func (*Atom) String

func (p *Atom) String() string

func (*Atom) Subst

func (p *Atom) Subst(xs RObj, lvs Level) Fof

func (*Atom) Tag

func (p *Atom) Tag() uint

type AtomF

type AtomF struct {
	FofTFbase
}

func (*AtomF) Deg

func (p *AtomF) Deg(lv Level) int

func (*AtomF) Equals

func (p *AtomF) Equals(qq interface{}) bool

func (*AtomF) FmlLess

func (p *AtomF) FmlLess(q Fof) bool

func (*AtomF) Format

func (p *AtomF) Format(s fmt.State, format rune)

func (*AtomF) Indets

func (p *AtomF) Indets(b []bool)

func (*AtomF) IsQff

func (p *AtomF) IsQff() bool

func (*AtomF) IsQuantifier

func (p *AtomF) IsQuantifier() bool

func (*AtomF) Not

func (p *AtomF) Not() Fof

func (*AtomF) String

func (p *AtomF) String() string

func (*AtomF) Subst

func (p *AtomF) Subst(xs RObj, lvs Level) Fof

func (*AtomF) Tag

func (p *AtomF) Tag() uint

type AtomProj

type AtomProj struct {
	Atom
	// contains filtered or unexported fields
}

type AtomT

type AtomT struct {
	FofTFbase
}

func (*AtomT) Deg

func (p *AtomT) Deg(lv Level) int

func (*AtomT) Equals

func (p *AtomT) Equals(qq interface{}) bool

func (*AtomT) FmlLess

func (p *AtomT) FmlLess(q Fof) bool

func (*AtomT) Format

func (p *AtomT) Format(s fmt.State, format rune)

func (*AtomT) Indets

func (p *AtomT) Indets(b []bool)

func (*AtomT) IsQff

func (p *AtomT) IsQff() bool

func (*AtomT) IsQuantifier

func (p *AtomT) IsQuantifier() bool

func (*AtomT) Not

func (p *AtomT) Not() Fof

func (*AtomT) String

func (p *AtomT) String() string

func (*AtomT) Subst

func (p *AtomT) Subst(xs RObj, lvs Level) Fof

func (*AtomT) Tag

func (p *AtomT) Tag() uint

type BinInt

type BinInt struct {
	Number
	// contains filtered or unexported fields
}

func NewBinInt

func NewBinInt(n *big.Int, m int) *BinInt

func (*BinInt) Abs

func (z *BinInt) Abs() NObj

func (*BinInt) Add

func (x *BinInt) Add(yy RObj) RObj

func (*BinInt) AddInt

func (x *BinInt) AddInt(y *Int) RObj

func (*BinInt) Cmp

func (z *BinInt) Cmp(xx NObj) int

func (*BinInt) CmpAbs

func (z *BinInt) CmpAbs(xx NObj) int

func (*BinInt) Div

func (x *BinInt) Div(yy NObj) RObj

func (*BinInt) Equals

func (x *BinInt) Equals(yy interface{}) bool

func (*BinInt) Float

func (z *BinInt) Float() float64

func (*BinInt) Format

func (x *BinInt) Format(s fmt.State, format rune)

func (*BinInt) IsMinusOne

func (x *BinInt) IsMinusOne() bool

func (*BinInt) IsOne

func (x *BinInt) IsOne() bool

func (*BinInt) IsZero

func (x *BinInt) IsZero() bool

func (*BinInt) Mul

func (x *BinInt) Mul(yy RObj) RObj

func (*BinInt) MulInt

func (x *BinInt) MulInt(y *Int) RObj

func (*BinInt) Neg

func (x *BinInt) Neg() RObj

func (*BinInt) Pow

func (x *BinInt) Pow(r *Int) RObj

func (*BinInt) Sign

func (x *BinInt) Sign() int

func (*BinInt) String

func (x *BinInt) String() string

func (*BinInt) Sub

func (x *BinInt) Sub(yy RObj) RObj

func (*BinInt) Subst

func (z *BinInt) Subst(x RObj, lv Level) RObj

func (*BinInt) ToIntRat

func (z *BinInt) ToIntRat() NObj

type CAD

type CAD struct {
	// contains filtered or unexported fields
}

func NewCAD

func NewCAD(prenex_formula Fof, g *Ganrac) (*CAD, error)

func (*CAD) Fprint

func (cad *CAD) Fprint(b io.Writer, args ...interface{}) error

func (*CAD) FprintInput

func (cad *CAD) FprintInput(b io.Writer, args ...interface{}) error

func (*CAD) FprintProj

func (cad *CAD) FprintProj(b io.Writer, args ...interface{}) error

func (*CAD) FprintProjs

func (cad *CAD) FprintProjs(b io.Writer, lv Level)

func (*CAD) Lift

func (cad *CAD) Lift(index ...int) error

func (*CAD) Print

func (cad *CAD) Print(args ...interface{}) error

func (*CAD) PrintProj

func (cad *CAD) PrintProj(args ...interface{})

func (*CAD) Projection

func (cad *CAD) Projection(algo ProjectionAlgo) (*List, error)

func (*CAD) Sfc

func (cad *CAD) Sfc() (Fof, error)

func (*CAD) String

func (c *CAD) String() string

func (*CAD) Tag

func (c *CAD) Tag() uint

type CADSfc

type CADSfc struct {
	// contains filtered or unexported fields
}

func NewCADSfc

func NewCADSfc(cad *CAD) *CADSfc

type CADStat

type CADStat struct {
	// contains filtered or unexported fields
}

func (CADStat) Fprint

func (stat CADStat) Fprint(b io.Writer, cad *CAD)

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func NewCell

func NewCell(cad *CAD, parent *Cell, idx uint) *Cell

func (*Cell) Fprint

func (cell *Cell) Fprint(b io.Writer, args ...interface{}) error

func (*Cell) Index

func (cell *Cell) Index() []uint

func (*Cell) Neg

func (cell *Cell) Neg() *Cell

func (*Cell) Prec

func (cell *Cell) Prec() uint

func (*Cell) Precs

func (cell *Cell) Precs() []uint

func (*Cell) Print

func (cell *Cell) Print(args ...interface{}) error

func (*Cell) Sign

func (cell *Cell) Sign() int

func (*Cell) Square

func (cell *Cell) Square(even int)

type Cellmod

type Cellmod struct {
	// contains filtered or unexported fields
}

func NewCellmod

func NewCellmod(cell *Cell) *Cellmod

type Dict

type Dict struct {
	GObj
	// contains filtered or unexported fields
}

func NewDict

func NewDict() *Dict

func (*Dict) Equals

func (z *Dict) Equals(vv interface{}) bool

func (*Dict) Format

func (z *Dict) Format(s fmt.State, format rune)

func (*Dict) Get

func (z *Dict) Get(k string) (GObj, error)

func (*Dict) Indets

func (z *Dict) Indets(b []bool)

func (*Dict) Len

func (z *Dict) Len() int

func (*Dict) Set

func (z *Dict) Set(k string, v GObj) error

func (*Dict) String

func (z *Dict) String() string

func (*Dict) Tag

func (z *Dict) Tag() uint

type Exists

type Exists struct {
	// contains filtered or unexported fields
}

func (*Exists) Deg

func (p *Exists) Deg(lv Level) int

func (*Exists) Equals

func (p *Exists) Equals(qq interface{}) bool

func (*Exists) Fml

func (p *Exists) Fml() Fof

func (*Exists) FmlLess

func (p *Exists) FmlLess(q Fof) bool

func (*Exists) Format

func (p *Exists) Format(b fmt.State, format rune)

func (*Exists) Get

func (p *Exists) Get(idx *Int) (interface{}, error)

func (*Exists) Indets

func (p *Exists) Indets(b []bool)

func (*Exists) IsQff

func (p *Exists) IsQff() bool

func (*Exists) IsQuantifier

func (p *Exists) IsQuantifier() bool

func (*Exists) Not

func (p *Exists) Not() Fof

func (*Exists) Qs

func (p *Exists) Qs() []Level

func (*Exists) String

func (p *Exists) String() string

func (*Exists) Subst

func (p *Exists) Subst(xs RObj, lvs Level) Fof

func (*Exists) Tag

func (p *Exists) Tag() uint

type Flusher

type Flusher interface {
	io.Writer
	Flush() error
}

type FmlAnd

type FmlAnd struct {
	// contains filtered or unexported fields
}

func (*FmlAnd) Deg

func (p *FmlAnd) Deg(lv Level) int

func (*FmlAnd) Equals

func (p *FmlAnd) Equals(qq interface{}) bool

func (*FmlAnd) FmlLess

func (p *FmlAnd) FmlLess(q Fof) bool

func (*FmlAnd) Fmls

func (p *FmlAnd) Fmls() []Fof

func (*FmlAnd) Format

func (p *FmlAnd) Format(b fmt.State, format rune)

func (*FmlAnd) Get

func (p *FmlAnd) Get(idx *Int) (Fof, error)

func (*FmlAnd) Indets

func (p *FmlAnd) Indets(b []bool)

func (*FmlAnd) IsQff

func (p *FmlAnd) IsQff() bool

func (*FmlAnd) IsQuantifier

func (p *FmlAnd) IsQuantifier() bool

func (*FmlAnd) Len

func (p *FmlAnd) Len() int

func (*FmlAnd) Not

func (p *FmlAnd) Not() Fof

func (*FmlAnd) String

func (p *FmlAnd) String() string

func (*FmlAnd) Subst

func (p *FmlAnd) Subst(xs RObj, lvs Level) Fof

func (*FmlAnd) Tag

func (p *FmlAnd) Tag() uint

type FmlOr

type FmlOr struct {
	// contains filtered or unexported fields
}

func (*FmlOr) Deg

func (p *FmlOr) Deg(lv Level) int

func (*FmlOr) Equals

func (p *FmlOr) Equals(qq interface{}) bool

func (*FmlOr) FmlLess

func (p *FmlOr) FmlLess(q Fof) bool

func (*FmlOr) Fmls

func (p *FmlOr) Fmls() []Fof

func (*FmlOr) Format

func (p *FmlOr) Format(b fmt.State, format rune)

func (*FmlOr) Get

func (p *FmlOr) Get(idx *Int) (Fof, error)

func (*FmlOr) Indets

func (p *FmlOr) Indets(b []bool)

func (*FmlOr) IsQff

func (p *FmlOr) IsQff() bool

func (*FmlOr) IsQuantifier

func (p *FmlOr) IsQuantifier() bool

func (*FmlOr) Len

func (p *FmlOr) Len() int

func (*FmlOr) Not

func (p *FmlOr) Not() Fof

func (*FmlOr) String

func (p *FmlOr) String() string

func (*FmlOr) Subst

func (p *FmlOr) Subst(xs RObj, lvs Level) Fof

func (*FmlOr) Tag

func (p *FmlOr) Tag() uint

type Fof

type Fof interface {
	GObj

	IsQff() bool
	IsQuantifier() bool

	Not() Fof

	Subst(xs RObj, lv Level) Fof

	Deg(lv Level) int
	FmlLess(a Fof) bool
	// contains filtered or unexported methods
}

first-order formula

func FofEquiv

func FofEquiv(f1, f2 Fof) Fof

func FofImpl

func FofImpl(f1, f2 Fof) Fof

func NewAtom

func NewAtom(p RObj, op OP) Fof

func NewAtoms

func NewAtoms(pp []RObj, op OP) Fof

func NewBool

func NewBool(b bool) Fof

func NewExists

func NewExists(lv []Level, fml Fof) Fof

func NewFmlAnd

func NewFmlAnd(pp Fof, qq Fof) Fof

func NewFmlOr

func NewFmlOr(pp Fof, qq Fof) Fof

func NewQuantifier

func NewQuantifier(forex bool, lvv []Level, fml Fof) Fof

type FofAO

type FofAO interface {
	// and/or
	Fof

	Fmls() []Fof
	// contains filtered or unexported methods
}

type FofQ

type FofQ interface {
	// quantifier
	Fof

	Qs() []Level
	Fml() Fof
	// contains filtered or unexported methods
}

type FofTFbase

type FofTFbase struct {
	Fof
}

type ForAll

type ForAll struct {
	// contains filtered or unexported fields
}

func (*ForAll) Deg

func (p *ForAll) Deg(lv Level) int

func (*ForAll) Equals

func (p *ForAll) Equals(qq interface{}) bool

func (*ForAll) Fml

func (p *ForAll) Fml() Fof

func (*ForAll) FmlLess

func (p *ForAll) FmlLess(q Fof) bool

func (*ForAll) Format

func (p *ForAll) Format(b fmt.State, format rune)

func (*ForAll) Get

func (p *ForAll) Get(idx *Int) (interface{}, error)

func (*ForAll) Indets

func (p *ForAll) Indets(b []bool)

func (*ForAll) IsQff

func (p *ForAll) IsQff() bool

func (*ForAll) IsQuantifier

func (p *ForAll) IsQuantifier() bool

func (*ForAll) Not

func (p *ForAll) Not() Fof

func (*ForAll) Qs

func (p *ForAll) Qs() []Level

func (*ForAll) String

func (p *ForAll) String() string

func (*ForAll) Subst

func (p *ForAll) Subst(xs RObj, lvs Level) Fof

func (*ForAll) Tag

func (p *ForAll) Tag() uint

type GObj

type GObj interface {
	fmt.Formatter
	String() string
	Tag() uint
}

ganrac object RObj, NObj, Fof, List, *String

type Ganrac

type Ganrac struct {
	// contains filtered or unexported fields
}

func NewGANRAC

func NewGANRAC() *Ganrac

func (*Ganrac) ConnectOX

func (g *Ganrac) ConnectOX(cw, dw Flusher, cr, dr io.Reader) error

func (*Ganrac) Eval

func (g *Ganrac) Eval(r io.Reader) (interface{}, error)

func (*Ganrac) InitVarList

func (g *Ganrac) InitVarList(vlist []string) error

func (*Ganrac) QE

func (g *Ganrac) QE(fof Fof, qeopt *QEopt) Fof

func (*Ganrac) SetLogger

func (g *Ganrac) SetLogger(logger *log.Logger)

type Int

type Int struct {
	Number
	// contains filtered or unexported fields
}

func NewInt

func NewInt(n int64) *Int

func NewIntZ

func NewIntZ(z *big.Int) *Int

func ParseInt

func ParseInt(s string, base int) *Int

func (*Int) Abs

func (z *Int) Abs() NObj

func (*Int) Add

func (x *Int) Add(y RObj) RObj

func (*Int) Bit

func (x *Int) Bit(i int) uint

func (*Int) Cmp

func (z *Int) Cmp(xx NObj) int

func (*Int) CmpAbs

func (z *Int) CmpAbs(xx NObj) int

func (*Int) Div

func (x *Int) Div(yy NObj) RObj

func (*Int) Equals

func (x *Int) Equals(y interface{}) bool

func (*Int) Float

func (z *Int) Float() float64

func (*Int) Format

func (x *Int) Format(s fmt.State, format rune)

func (*Int) Gcd

func (x *Int) Gcd(y *Int) *Int

func (*Int) GcdEx

func (x *Int) GcdEx(y *Int) (*Int, *Int, *Int)

func (*Int) Int64

func (x *Int) Int64() int64

func (*Int) IsInt64

func (x *Int) IsInt64() bool

func (*Int) IsMinusOne

func (x *Int) IsMinusOne() bool

func (*Int) IsOne

func (x *Int) IsOne() bool

func (*Int) IsZero

func (x *Int) IsZero() bool

func (*Int) Mul

func (x *Int) Mul(y RObj) RObj

func (*Int) Neg

func (x *Int) Neg() RObj

func (*Int) Pow

func (x *Int) Pow(y *Int) RObj

func (*Int) Set

func (x *Int) Set(y RObj) RObj

func (*Int) Sign

func (x *Int) Sign() int

func (*Int) String

func (x *Int) String() string

func (*Int) Sub

func (x *Int) Sub(y RObj) RObj

func (*Int) Subst

func (z *Int) Subst(x RObj, lv Level) RObj

type Interval

type Interval struct {
	// contains filtered or unexported fields
}

func FRealRoot

func FRealRoot(prec uint, lmax int, poly []*big.Float, rand float64) []*Interval

func NewIntervalFloat

func NewIntervalFloat(n *big.Float, prec uint) *Interval

func NewIntervalInt64

func NewIntervalInt64(n int64, prec uint) *Interval

func (*Interval) Abs

func (x *Interval) Abs() NObj

func (*Interval) Add

func (x *Interval) Add(yy RObj) RObj

func (*Interval) AddFloat

func (x *Interval) AddFloat(y *big.Float) *Interval

func (*Interval) Cmp

func (x *Interval) Cmp(y NObj) int

func (*Interval) CmpAbs

func (x *Interval) CmpAbs(y NObj) int

func (*Interval) ContainsZero

func (c *Interval) ContainsZero() bool

func (*Interval) Div

func (x *Interval) Div(yy NObj) RObj

func (*Interval) Equals

func (x *Interval) Equals(v interface{}) bool

func (*Interval) Float

func (x *Interval) Float() float64

func (*Interval) Format

func (x *Interval) Format(s fmt.State, format rune)

func (*Interval) IsMinusOne

func (x *Interval) IsMinusOne() bool

func (*Interval) IsNumeric

func (x *Interval) IsNumeric() bool

func (*Interval) IsOne

func (x *Interval) IsOne() bool

func (*Interval) IsZero

func (x *Interval) IsZero() bool

func (*Interval) Mul

func (x *Interval) Mul(yy RObj) RObj

func (*Interval) Mul2Exp

func (x *Interval) Mul2Exp(m uint) NObj

func (*Interval) MulFloat

func (x *Interval) MulFloat(y *big.Float) *Interval

func (*Interval) MulInt64

func (x *Interval) MulInt64(y int64) *Interval

func (*Interval) Neg

func (x *Interval) Neg() RObj

func (*Interval) Pow

func (x *Interval) Pow(yy *Int) RObj

func (*Interval) Prec

func (z *Interval) Prec() uint

func (*Interval) SetFloat

func (z *Interval) SetFloat(n *big.Float)

func (*Interval) SetFloat64

func (z *Interval) SetFloat64(n float64)

func (*Interval) SetInt64

func (z *Interval) SetInt64(n int64)

func (*Interval) SetPrec

func (z *Interval) SetPrec(prec uint)

func (*Interval) Sign

func (x *Interval) Sign() int

func (*Interval) String

func (z *Interval) String() string

func (*Interval) Sub

func (x *Interval) Sub(yy RObj) RObj

func (*Interval) SubFloat

func (x *Interval) SubFloat(y *big.Float) *Interval

func (*Interval) Subst

func (x *Interval) Subst(v RObj, lv Level) RObj

func (*Interval) Tag

func (x *Interval) Tag() uint

type Level

type Level int8

type Levels

type Levels []Level

type List

type List struct {
	GObj
	// contains filtered or unexported fields
}

func NewList

func NewList(args ...interface{}) *List

func (*List) Append

func (z *List) Append(a GObj)

func (*List) Equals

func (z *List) Equals(vv interface{}) bool

func (*List) Format

func (z *List) Format(s fmt.State, format rune)

func (*List) Get

func (z *List) Get(ii *Int) (GObj, error)

func (*List) Geti

func (z *List) Geti(i int) (GObj, error)

func (*List) Indets

func (z *List) Indets(b []bool)

func (*List) Iter

func (z *List) Iter() []GObj

func (*List) Len

func (z *List) Len() int

func (*List) Set

func (z *List) Set(ii *Int, v GObj) error

func (*List) String

func (z *List) String() string

func (*List) Subst

func (z *List) Subst(xs RObj, lvs Level) *List

func (*List) Tag

func (z *List) Tag() uint

type Moder

type Moder interface {
	// modular arithmetic
	RObj
	// contains filtered or unexported methods
}

type NObj

type NObj interface {
	RObj

	Float() float64
	Cmp(x NObj) int
	CmpAbs(x NObj) int
	Abs() NObj
	// contains filtered or unexported methods
}

numeric *Int, *Rat, *BinInt, *Interval

type NumRegion

type NumRegion struct {
	// contains filtered or unexported fields
}

nil は empty set を表す.

func (*NumRegion) Format

func (m *NumRegion) Format(s fmt.State, format rune)

type Number

type Number struct {
}

func (*Number) IsNumeric

func (x *Number) IsNumeric() bool

func (*Number) String

func (x *Number) String() string

func (*Number) Tag

func (x *Number) Tag() uint

type OP

type OP uint8

func (OP) String

func (op OP) String() string

type OpenXM

type OpenXM struct {
	// contains filtered or unexported fields
}

func NewOpenXM

func NewOpenXM(controlw, dataw Flusher, controlr, datar io.Reader, logger *log.Logger) *OpenXM

func (*OpenXM) Discrim

func (ox *OpenXM) Discrim(p *Poly, lv Level) RObj

func (*OpenXM) ExecFunction

func (ox *OpenXM) ExecFunction(funcname string, argv ...interface{}) error

func (*OpenXM) ExecString

func (ox *OpenXM) ExecString(val string) error

func (*OpenXM) Factor

func (ox *OpenXM) Factor(p *Poly) *List

func (*OpenXM) GB

func (ox *OpenXM) GB(p *List, vars *List, n int) *List

func (*OpenXM) Gcd

func (ox *OpenXM) Gcd(p, q *Poly) RObj

func (*OpenXM) Init

func (ox *OpenXM) Init() error

func (*OpenXM) PopCMO

func (ox *OpenXM) PopCMO() (interface{}, error)

func (*OpenXM) PopOXTag

func (ox *OpenXM) PopOXTag() (int32, int32, error)

func (*OpenXM) PopString

func (ox *OpenXM) PopString() (string, error)

func (*OpenXM) Psc

func (ox *OpenXM) Psc(p *Poly, q *Poly, lv Level, j int32) RObj

func (*OpenXM) PushOXCommand

func (ox *OpenXM) PushOXCommand(sm_command int32) error

func (*OpenXM) PushOXTag

func (ox *OpenXM) PushOXTag(tag int32) error

func (*OpenXM) PushOxCMO

func (ox *OpenXM) PushOxCMO(vv interface{}) error

func (*OpenXM) Reduce

func (ox *OpenXM) Reduce(p *Poly, gb *List, vars *List, n int) (RObj, bool)

func (*OpenXM) Resultant

func (ox *OpenXM) Resultant(p *Poly, q *Poly, lv Level) RObj

func (*OpenXM) Sres

func (ox *OpenXM) Sres(p *Poly, q *Poly, lv Level, k int32) RObj

type Poly

type Poly struct {
	// contains filtered or unexported fields
}

poly in K[x_lv,...,x_n]

func NewPoly

func NewPoly(lv Level, deg_plus_1 int) *Poly

func NewPolyCoef

func NewPolyCoef(lv Level, coeffs ...interface{}) *Poly

func NewPolyInts

func NewPolyInts(lv Level, coeffs ...int64) *Poly

func NewPolyVar

func NewPolyVar(lv Level) *Poly

func (*Poly) Add

func (x *Poly) Add(y RObj) RObj

func (*Poly) Clone

func (z *Poly) Clone() *Poly

func (*Poly) Cmp

func (p *Poly) Cmp(q *Poly) int

func (*Poly) Coef

func (z *Poly) Coef(lv Level, deg uint) RObj

func (*Poly) Deg

func (z *Poly) Deg(lv Level) int

func (*Poly) Div

func (x *Poly) Div(y NObj) RObj

func (*Poly) Equals

func (z *Poly) Equals(x interface{}) bool

func (*Poly) Format

func (z *Poly) Format(s fmt.State, format rune)

func (*Poly) Indets

func (z *Poly) Indets(b []bool)

func (*Poly) IsMinusOne

func (z *Poly) IsMinusOne() bool

func (*Poly) IsNumeric

func (z *Poly) IsNumeric() bool

func (*Poly) IsOne

func (z *Poly) IsOne() bool

func (*Poly) IsZero

func (z *Poly) IsZero() bool

func (*Poly) LeadinfCoef

func (z *Poly) LeadinfCoef() NObj

func (*Poly) Less

func (p *Poly) Less(q *Poly) bool

func (*Poly) Mul

func (x *Poly) Mul(yy RObj) RObj

func (*Poly) Neg

func (z *Poly) Neg() RObj

func (*Poly) Pow

func (x *Poly) Pow(y *Int) RObj

func (*Poly) RealRootIsolation

func (p *Poly) RealRootIsolation(prec int) (*List, error)

func (*Poly) RootBound

func (z *Poly) RootBound() (NObj, error)

func (*Poly) Set

func (z *Poly) Set(x RObj) RObj

func (*Poly) Sign

func (z *Poly) Sign() int

func (*Poly) String

func (z *Poly) String() string

func (*Poly) Sub

func (z *Poly) Sub(y RObj) RObj

func (*Poly) Subst

func (z *Poly) Subst(xs RObj, lv Level) RObj

func (*Poly) SubstIntv

func (z *Poly) SubstIntv(x *Interval, lv Level, prec uint) RObj

区間の代入なので 2 乗を利用したい.

func (*Poly) Tag

func (z *Poly) Tag() uint

type ProjFactor

type ProjFactor interface {
	P() *Poly
	Lv() Level
	Deg() int

	Index() uint
	SetIndex(i uint)

	// 入力の論理式に含まれるなら true
	Input() bool
	SetInputT(b bool)

	// 数値手法による評価
	Sign() sign_t
	SetSign(sgn sign_t)

	// 表示用
	FprintProjFactor(b io.Writer, cad *CAD)
	// contains filtered or unexported methods
}

type ProjFactorBase

type ProjFactorBase struct {
	// contains filtered or unexported fields
}

func (*ProjFactorBase) Deg

func (pfb *ProjFactorBase) Deg() int

func (*ProjFactorBase) Index

func (pfb *ProjFactorBase) Index() uint

func (*ProjFactorBase) Input

func (pfb *ProjFactorBase) Input() bool

func (*ProjFactorBase) Lv

func (pfb *ProjFactorBase) Lv() Level

func (*ProjFactorBase) P

func (pfb *ProjFactorBase) P() *Poly

func (*ProjFactorBase) SetIndex

func (pfb *ProjFactorBase) SetIndex(i uint)

func (*ProjFactorBase) SetInputT

func (pfb *ProjFactorBase) SetInputT(b bool)

func (*ProjFactorBase) SetSign

func (pfb *ProjFactorBase) SetSign(b sign_t)

func (*ProjFactorBase) Sign

func (pfb *ProjFactorBase) Sign() sign_t

type ProjFactorHH

type ProjFactorHH struct {
	ProjFactorBase
	// contains filtered or unexported fields
}

func (*ProjFactorHH) FprintProjFactor

func (pf *ProjFactorHH) FprintProjFactor(b io.Writer, cad *CAD)

type ProjFactorMC

type ProjFactorMC struct {
	ProjFactorBase
	// contains filtered or unexported fields
}

func (*ProjFactorMC) FprintProjFactor

func (pf *ProjFactorMC) FprintProjFactor(b io.Writer, cad *CAD)

type ProjFactors

type ProjFactors interface {
	Len() int
	// contains filtered or unexported methods
}

type ProjFactorsHH

type ProjFactorsHH struct {
	// contains filtered or unexported fields
}

func (*ProjFactorsHH) Len

func (pfs *ProjFactorsHH) Len() int

type ProjFactorsMC

type ProjFactorsMC struct {
	// contains filtered or unexported fields
}

func (*ProjFactorsMC) Len

func (pfs *ProjFactorsMC) Len() int
type ProjLink struct {
	// contains filtered or unexported fields
}

func (*ProjLink) Fprint

func (pl *ProjLink) Fprint(b io.Writer)

type ProjectionAlgo

type ProjectionAlgo int

type QEopt

type QEopt struct {
	Algo algo_t
	// contains filtered or unexported fields
}

func NewQEopt

func NewQEopt() *QEopt

func (*QEopt) SetAlgo

func (qeopt *QEopt) SetAlgo(algo algo_t, v bool)

type QeExample

type QeExample struct {
	Input  Fof
	Output Fof
	Ref    string
	DOI    string
}

func GetExampleFof

func GetExampleFof(name string) *QeExample

type RObj

type RObj interface {
	GObj

	Add(x RObj) RObj // z+x
	Sub(x RObj) RObj // z-x
	Mul(x RObj) RObj
	Div(x NObj) RObj
	Pow(x *Int) RObj
	Subst(x RObj, lv Level) RObj
	Neg() RObj
	//	Set(x RObj) RObj
	Sign() int
	IsZero() bool
	IsOne() bool
	IsMinusOne() bool
	IsNumeric() bool
	// contains filtered or unexported methods
}

ring ring in R[x], in R *Poly, *Int, *Rat, *BinInt, *Interval

func Add

func Add(x, y RObj) RObj

func Mul

func Mul(x, y RObj) RObj

func Sub

func Sub(x, y RObj) RObj

type RObjSample

type RObjSample struct {
}

func (*RObjSample) Add

func (z *RObjSample) Add(x RObj) RObj

func (*RObjSample) Div

func (z *RObjSample) Div(x NObj) RObj

func (*RObjSample) Equals

func (z *RObjSample) Equals(x interface{}) bool

func (*RObjSample) Format

func (z *RObjSample) Format(s fmt.State, format rune)

func (*RObjSample) IsMinusOne

func (z *RObjSample) IsMinusOne() bool

func (*RObjSample) IsNumeric

func (z *RObjSample) IsNumeric() bool

func (*RObjSample) IsOne

func (z *RObjSample) IsOne() bool

func (*RObjSample) IsZero

func (z *RObjSample) IsZero() bool

func (*RObjSample) Mul

func (z *RObjSample) Mul(x RObj) RObj

func (*RObjSample) Neg

func (z *RObjSample) Neg() RObj

func (*RObjSample) Pow

func (z *RObjSample) Pow(x *Int) RObj

func (*RObjSample) Set

func (z *RObjSample) Set(x RObj) RObj

func (*RObjSample) Sign

func (z *RObjSample) Sign() int

func (*RObjSample) String

func (z *RObjSample) String() string

func (*RObjSample) Sub

func (z *RObjSample) Sub(x RObj) RObj

func (*RObjSample) Subst

func (z *RObjSample) Subst(x RObj, lv Level) RObj

func (*RObjSample) Tag

func (z *RObjSample) Tag() uint

type Rat

type Rat struct {
	Number
	// contains filtered or unexported fields
}

func NewRatFrac

func NewRatFrac(num, den *Int) *Rat

func NewRatInt64

func NewRatInt64(num, den int64) *Rat

func (*Rat) Abs

func (z *Rat) Abs() NObj

func (*Rat) Add

func (x *Rat) Add(yy RObj) RObj

func (*Rat) Cmp

func (z *Rat) Cmp(xx NObj) int

func (*Rat) CmpAbs

func (z *Rat) CmpAbs(xx NObj) int

func (*Rat) Div

func (x *Rat) Div(yy NObj) RObj

func (*Rat) Equals

func (x *Rat) Equals(y interface{}) bool

func (*Rat) Float

func (z *Rat) Float() float64

func (*Rat) Format

func (x *Rat) Format(s fmt.State, format rune)

func (*Rat) IsMinusOne

func (x *Rat) IsMinusOne() bool

func (*Rat) IsOne

func (x *Rat) IsOne() bool

func (*Rat) IsZero

func (x *Rat) IsZero() bool

func (*Rat) Mul

func (x *Rat) Mul(yy RObj) RObj

func (*Rat) Neg

func (x *Rat) Neg() RObj

func (*Rat) Pow

func (x *Rat) Pow(y *Int) RObj

func (*Rat) Sign

func (x *Rat) Sign() int

func (*Rat) String

func (x *Rat) String() string

func (*Rat) Sub

func (x *Rat) Sub(yy RObj) RObj

func (*Rat) Subst

func (z *Rat) Subst(x RObj, lv Level) RObj

type String

type String struct {
	GObj
	// contains filtered or unexported fields
}

func NewString

func NewString(s string) *String

func (*String) Format

func (z *String) Format(s fmt.State, format rune)

func (*String) String

func (s *String) String() string

func (*String) Tag

func (s *String) Tag() uint

type Uint

type Uint uint32

func (Uint) Abs

func (p Uint) Abs() NObj

func (Uint) Add

func (p Uint) Add(x RObj) RObj

func (Uint) Cmp

func (p Uint) Cmp(x NObj) int

func (Uint) CmpAbs

func (p Uint) CmpAbs(x NObj) int

func (Uint) Div

func (p Uint) Div(x NObj) RObj

func (Uint) Equals

func (p Uint) Equals(v interface{}) bool

func (Uint) Float

func (p Uint) Float() float64

func (Uint) Format

func (p Uint) Format(s fmt.State, format rune)

func (Uint) IsMinusOne

func (p Uint) IsMinusOne() bool

func (Uint) IsNumeric

func (p Uint) IsNumeric() bool

func (Uint) IsOne

func (p Uint) IsOne() bool

func (Uint) IsZero

func (p Uint) IsZero() bool

func (Uint) Mul

func (p Uint) Mul(x RObj) RObj

func (Uint) Neg

func (p Uint) Neg() RObj

func (Uint) Pow

func (p Uint) Pow(x *Int) RObj

func (Uint) Sign

func (p Uint) Sign() int

func (Uint) String

func (p Uint) String() string

func (Uint) Sub

func (p Uint) Sub(x RObj) RObj

func (Uint) Subst

func (p Uint) Subst(x RObj, lv Level) RObj

func (Uint) Tag

func (p Uint) Tag() uint

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL