2023-01-08 22:34:27 +00:00

23 lines
3.8 KiB
Go

//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
package basic ;import _de "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_ca NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_ca )-1{return 0,_de .Errorf ("\u004e\u0075\u006dS\u006c\u0069\u0063\u0065\u002e\u0047\u0065\u0074","\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );
};return _ca [i ],nil ;};func NewIntSlice (i int )*IntSlice {_ga :=IntSlice (make ([]int ,i ));return &_ga };func (_ce *NumSlice )Add (v float32 ){*_ce =append (*_ce ,v )};func (_ab *Stack )peek ()(interface{},bool ){_dd :=_ab .top ();if _dd ==-1{return nil ,false ;
};return _ab .Data [_dd ],true ;};func Abs (v int )int {if v > 0{return v ;};return -v ;};func (_gfa IntSlice )Size ()int {return len (_gfa )};func (_fc *IntSlice )Add (v int )error {if _fc ==nil {return _de .Error ("\u0049\u006e\u0074S\u006c\u0069\u0063\u0065\u002e\u0041\u0064\u0064","\u0073\u006c\u0069\u0063\u0065\u0020\u006e\u006f\u0074\u0020\u0064\u0065f\u0069\u006e\u0065\u0064");
};*_fc =append (*_fc ,v );return nil ;};func (_ee IntSlice )Get (index int )(int ,error ){if index > len (_ee )-1{return 0,_de .Errorf ("\u0049\u006e\u0074S\u006c\u0069\u0063\u0065\u002e\u0047\u0065\u0074","\u0069\u006e\u0064\u0065x:\u0020\u0025\u0064\u0020\u006f\u0075\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006eg\u0065",index );
};return _ee [index ],nil ;};func (_bb NumSlice )GetIntSlice ()[]int {_dgb :=make ([]int ,len (_bb ));for _bad ,_cg :=range _bb {_dgb [_bad ]=int (_cg );};return _dgb ;};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_da *Stack )Len ()int {return len (_da .Data )};
func (_eg *Stack )Push (v interface{}){_eg .Data =append (_eg .Data ,v )};func (_c *IntSlice )Copy ()*IntSlice {_a :=IntSlice (make ([]int ,len (*_c )));copy (_a ,*_c );return &_a ;};type Stack struct{Data []interface{};Aux *Stack ;};type NumSlice []float32 ;
type IntsMap map[uint64 ][]int ;func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};type IntSlice []int ;func Max (x ,y int )int {if x > y {return x ;};return y ;};func (_b IntsMap )Add (key uint64 ,value int ){_b [key ]=append (_b [key ],value )};
func (_gb NumSlice )GetInt (i int )(int ,error ){const _fd ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_gb )-1{return 0,_de .Errorf (_fd ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );
};_bae :=_gb [i ];return int (_bae +Sign (_bae )*0.5),nil ;};func (_f IntsMap )Delete (key uint64 ){delete (_f ,key )};func (_be *Stack )Peek ()(_dc interface{},_dec bool ){return _be .peek ()};func (_ae *Stack )top ()int {return len (_ae .Data )-1};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;
};return (numerator /denominator )+1;};func (_g IntsMap )GetSlice (key uint64 )([]int ,bool ){_gf ,_dg :=_g [key ];if !_dg {return nil ,false ;};return _gf ,true ;};func (_ad *NumSlice )AddInt (v int ){*_ad =append (*_ad ,float32 (v ))};func (_e IntsMap )Get (key uint64 )(int ,bool ){_bd ,_ba :=_e [key ];
if !_ba {return 0,false ;};if len (_bd )==0{return 0,false ;};return _bd [0],true ;};func (_gg *Stack )Pop ()(_cef interface{},_ge bool ){_cef ,_ge =_gg .peek ();if !_ge {return nil ,_ge ;};_gg .Data =_gg .Data [:_gg .top ()];return _cef ,true ;};func NewNumSlice (i int )*NumSlice {_eb :=NumSlice (make ([]float32 ,i ));
return &_eb };