Example #1
0
    protected override void SolveInstance(Grasshopper.Kernel.IGH_DataAccess DA)
    {
        init();
            _listSrf = new List<Surface>();
            _listCrv = new List<Curve>();
            listPnt = new List<Point3d>();
            List<string> crvTypes = new List<string>();
            List<string> pntHeights = new List<string>();
            if (!DA.GetDataList(0, _listSrf)) { return; }
            if (!DA.GetDataList(1, _listCrv)) { return; }
            if (!DA.GetDataList(2, crvTypes)) { return; }
            if (!DA.GetDataList(3, listPnt)) { listPnt.Clear(); }
            if (!DA.GetData(4, ref globalC)) { return; }

            if (_listCrv.Count != crvTypes.Count) { AddRuntimeMessage(Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, "need types for curves"); return; }

            listSlice = new Dictionary<string, slice>();
            listSlice2 = new Dictionary<string, slice2>();
            listRange = new Dictionary<string, range>();
            listRangeOpen = new Dictionary<string, range>();
            listRangeLeaf = new Dictionary<string, range>();
            listLeaf = new List<leaf>();
            listBranch = new List<branch>();
            listNode=new List<node>();
            myControlBox.clearSliders();
            for (int i = 0; i < _listCrv.Count; i++)
            {
                var branch = new branch();
                branch.crv = _listCrv[i] as NurbsCurve;
                branch.N = branch.crv.Points.Count;
                branch.dom = branch.crv.Domain;
                branch.Dim= branch.crv.Order;
                branch.dDim = branch.crv.Order - 1;
                branch.nElem = branch.N - branch.dDim;
                branch.scaleT = (branch.dom.T1 - branch.dom.T0) / branch.nElem;
                branch.originT = branch.dom.T0;
                if(crvTypes[i].StartsWith("reinforce"))
                {
                    branch.branchType = branch.type.reinforce;
                    var key=crvTypes[i].Replace("reinforce","");
                    branch.sliceKey=key;
                    try{
                        branch.slice=listSlice[key];
                        branch.slice.sliceType = slice.type.fr;
                        branch.slice.lB.Add(branch);
                    }
                    catch (KeyNotFoundException e){
                        listSlice[key]=new slice();
                        branch.slice=listSlice[key];
                        branch.slice.sliceType=slice.type.fr;
                        branch.slice.lB.Add(branch);
                    }
                }
                else if(crvTypes[i].StartsWith("kink"))
                {
                    branch.branchType = branch.type.kink;
                    var key = crvTypes[i].Replace("kink", "");
                    if (key == "") key = "kink"; else key = "kink:" + key;
                    branch.sliceKey = key;
                    try
                    {
                        branch.range = listRange[key];
                        branch.range.rangeType = range.type.lo;
                        branch.range.lb = 0;
                        branch.range.ub = 0;
                        branch.range.lB.Add(branch);

                    }
                    catch (KeyNotFoundException)
                    {
                        listRange[key] = new range();
                        branch.range = listRange[key];
                        branch.range.rangeType = range.type.lo;
                        branch.range.lb = 0;
                        branch.range.ub = 0;
                        branch.range.lB.Add(branch);
                        var adjuster = myControlBox.addRangeSetter(key, (th,sw, lb, ub) =>
                        {
                            if (listRange[key].firstPathDone)
                            {
                                th.setMeasured(listRange[key].lastMin,listRange[key].lastMax);
                            }
                            foreach (var _branch in listRange[key].lB)
                            {
                                if (sw == 0)
                                {
                                    _branch.range.rangeType = range.type.lo;
                                    _branch.range.lb = lb;
                                    _branch.range.ub = 0d;
                                }
                                if (sw == 2)
                                {
                                    _branch.range.rangeType = range.type.ra;
                                    _branch.range.lb = lb;
                                    _branch.range.ub = ub;
                                }
                            }
                        }
                         );
                    }

                }else if(crvTypes[i].StartsWith("open"))
                {
                    branch.branchType = branch.type.open;
                    var key = crvTypes[i].Replace("open", "");
                    if (key == "") key = "open"; else key = "open:" + key;
                    branch.sliceKey = key;
                    try
                    {
                        branch.slice = listSlice[key];
                        branch.slice.sliceType = slice.type.fr;
                        branch.slice.lB.Add(branch);
                    }
                    catch (KeyNotFoundException e)
                    {
                        listSlice[key] = new slice();
                        branch.slice = listSlice[key];
                        branch.slice.sliceType = slice.type.fr;
                        branch.slice.lB.Add(branch);
                    }
                    try
                    {
                        branch.range = listRangeOpen[key];
                        branch.range.rangeType = range.type.lo;
                        branch.range.lb = 0;
                        branch.range.ub = 0;
                        branch.range.lB.Add(branch);
                    }
                    catch (KeyNotFoundException)
                    {
                        listRangeOpen[key] = new range();
                        branch.range = listRangeOpen[key];
                        branch.range.rangeType = range.type.lo;
                        branch.range.lb = 0;
                        branch.range.ub = 0;
                        branch.range.lB.Add(branch);
                        var adjuster = myControlBox.addRangeSetter(key, (th,sw, lb, ub) =>
                        {
                            if (listRangeOpen[key].firstPathDone)
                            {
                                th.setMeasured(listRangeOpen[key].lastMin,listRangeOpen[key].lastMax);
                            }
                            foreach (var _branch in listRangeOpen[key].lB)
                            {
                                if (sw == 0)
                                {
                                    _branch.range.rangeType = range.type.lo;
                                    _branch.range.lb = lb;
                                    _branch.range.ub = 0d;
                                }
                                if (sw == 2)
                                {
                                    _branch.range.rangeType = range.type.ra;
                                    _branch.range.lb = lb;
                                    _branch.range.ub = ub;
                                }
                            }
                        }
                            );
                    }
                }
                else if (crvTypes[i].StartsWith("fix"))
                {
                    branch.branchType = branch.type.fix;
                    var key = crvTypes[i].Replace("fix", "");
                    branch.sliceKey = key;
                    try
                    {
                        branch.slice2 = listSlice2[key];
                    }
                    catch (KeyNotFoundException e)
                    {
                        listSlice2[key] = new slice2();
                        branch.slice2 = listSlice2[key];

                        var slider = myControlBox.addSliderVert(0, 1, 200, 100);
                        slider.Converter = (val) =>
                            {
                                double height = val / 10d - 10d;
                                branch.slice2.height = height;
                                this.ExpirePreview(true);
                                return height;
                            };
                    }
                }else{
                        AddRuntimeMessage(Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, "type should be either of reinforce, kink, fix, or open");
                }
                listBranch.Add(branch);
            }

            for(int i=0;i<_listSrf.Count;i++)
            {
                var srf = _listSrf[i];
                var leaf=new leaf();
                listLeaf.Add(leaf);
                leaf.srf = srf as NurbsSurface;
                leaf.nU = leaf.srf.Points.CountU;
                leaf.nV = leaf.srf.Points.CountV;
                leaf.domU = leaf.srf.Domain(0);
                leaf.domV = leaf.srf.Domain(1);
                leaf.uDim = leaf.srf.OrderU;
                leaf.vDim = leaf.srf.OrderV;
                leaf.uDdim = leaf.srf.OrderU - 1;
                leaf.vDdim = leaf.srf.OrderV - 1;
                leaf.nUelem = leaf.nU - leaf.uDdim;
                leaf.nVelem = leaf.nV - leaf.vDdim;
                leaf.scaleU = (leaf.domU.T1 - leaf.domU.T0) / leaf.nUelem;
                leaf.scaleV = (leaf.domV.T1 - leaf.domV.T0) / leaf.nVelem;
                leaf.originU = leaf.domU.T0;
                leaf.originV = leaf.domV.T0;
                var domainU = leaf.srf.Domain(0);
                var domainV = leaf.srf.Domain(1);
                //Find corresponding curve
                //(0,0)->(1,0)
                var curve = leaf.srf.IsoCurve(0, domainV.T0) as NurbsCurve;
                leaf.flip[0] = findCurve(leaf,ref leaf.branch[0], listBranch, curve);//bottom
                //(1,0)->(1,1)
                curve = leaf.srf.IsoCurve(1, domainU.T1) as NurbsCurve;
                leaf.flip[1] = findCurve(leaf, ref leaf.branch[1], listBranch, curve);//right
                //(1,1)->(0,1)
                curve = leaf.srf.IsoCurve(0, domainV.T1) as NurbsCurve;
                leaf.flip[2] = findCurve(leaf, ref leaf.branch[2], listBranch, curve);//top
                //(0,1)->(0,0)
                curve = leaf.srf.IsoCurve(1, domainU.T0) as NurbsCurve;
                leaf.flip[3] = findCurve(leaf, ref leaf.branch[3], listBranch, curve);//left

                var key = "leaf";
                try
                {
                    leaf.range = listRangeLeaf[key];
                    leaf.range.rangeType = range.type.lo;
                    leaf.range.lb = 0;
                    leaf.range.ub = 0;
                    leaf.range.lL.Add(leaf);
                }
                catch (KeyNotFoundException)
                {
                    listRangeLeaf[key] = new range();
                    leaf.range = listRangeLeaf[key];
                    leaf.range.rangeType = range.type.lo;
                    leaf.range.lb = 0;
                    leaf.range.ub = 0;
                    leaf.range.lL.Add(leaf);
                    var adjuster = myControlBox.addRangeSetter(key, (th, sw, lb, ub) =>
                    {
                        if (listRangeLeaf[key].firstPathDone)
                        {
                            th.setMeasured(listRangeLeaf[key].lastMin, listRangeLeaf[key].lastMax);
                        }
                        foreach (var _leaf in listRangeLeaf[key].lL)
                        {
                            if (sw == 0)
                            {
                                _leaf.range.rangeType = range.type.lo;
                                _leaf.range.lb = lb;
                                _leaf.range.ub = 0d;
                            }
                            if (sw == 2)
                            {
                                _leaf.range.rangeType = range.type.ra;
                                _leaf.range.lb = lb;
                                _leaf.range.ub = ub;
                            }
                        }
                    }
                     );
                }

            }
            // Connect nodes
            foreach (var leaf in listLeaf)
            {
                leaf.globalIndex = new int[leaf.srf.Points.CountU * leaf.srf.Points.CountV];
                for (int j = 0; j < leaf.srf.Points.CountV; j++)
                {
                    for (int i = 0; i < leaf.srf.Points.CountU; i++)
                    {
                        var P = leaf.srf.Points.GetControlPoint(i, j).Location;
                        bool flag = false;
                        foreach (var node in listNode)
                        {
                            if (node.compare(P))
                            {
                                flag = true;
                                node.N++;
                                node.shareL.Add(leaf);
                                node.numberL.Add(i + j * leaf.nU);
                                leaf.globalIndex[i + j * leaf.nU] = listNode.IndexOf(node);
                                break;
                            }
                        }
                        if (!flag)
                        {
                            var newNode = new node();
                            listNode.Add(newNode);
                            newNode.N = 1;
                            newNode.x = P.X;
                            newNode.y = P.Y;
                            newNode.z = P.Z;
                            newNode.shareL.Add(leaf);
                            newNode.numberL.Add(i + j * leaf.nU);
                            leaf.globalIndex[i + j * leaf.nU] = listNode.IndexOf(newNode);
                        }
                    }
                }
            }
            foreach (var branch in listBranch)
            {
                branch.globalIndex = new int[branch.crv.Points.Count];
                for (int i = 0; i < branch.crv.Points.Count; i++)
                {
                    var P = branch.crv.Points[i].Location;
                    bool flag = false;
                    foreach (var node in listNode)
                    {
                        if (node.compare(P))
                        {
                            flag = true;
                            node.N++;
                            node.shareB.Add(branch);
                            node.numberB.Add(i);
                            if (branch.branchType == branch.type.fix)
                            {
                                node.nodeType = node.type.fx;
                            }
                            branch.globalIndex[i] = listNode.IndexOf(node);
                            break;
                        }
                    }
                    if (!flag)
                    {
                        var newNode = new node();
                        listNode.Add(newNode);
                        newNode.N = 1;
                        newNode.shareB.Add(branch);
                        newNode.numberB.Add(i);
                        newNode.x = P.X;
                        newNode.y = P.Y;
                        newNode.z = P.Z;
                        if (branch.branchType == branch.type.fix)
                        {
                            newNode.nodeType = node.type.fx;
                        }
                        branch.globalIndex[i] = listNode.IndexOf(newNode);
                    }
                }
            }
            //multiqudric surface
            var A=new Rhino.Geometry.Matrix(listPnt.Count,listPnt.Count);
            var z=new Rhino.Geometry.Matrix(listPnt.Count,1);
            for(int i=0;i<listPnt.Count;i++)
            {
                for(int j=0;j<listPnt.Count;j++)
                {
                    var pi=listPnt[i];
                    var pj=listPnt[j];
                    A[i,j]=quadFunc(pi.X,pj.X,pi.Y,pj.Y);
                    z[i,0]=pi.Z;
                }
            }
            A.Invert(0.0);  //this parameter should be 0.0
            var c=A*z;
            globalCoeff=new double[listPnt.Count];
            for(int i=0;i<listPnt.Count;i++)
            {
                globalCoeff[i]=c[i,0];
            }
            targetSrf=new List<Point3d>();
            globalFunc=(xi,yi)=>{
                double Z=0;
                for(int j=0;j<listPnt.Count;j++)
                {
                    Z=Z+globalCoeff[j]*quadFunc(xi,listPnt[j].X,yi,listPnt[j].Y);
                }
                return Z;
                };
            foreach (var leaf in listLeaf)
            {
                var domU = leaf.domU;
                var domV = leaf.domV;
                for (double i = 0; i <= 1.0; i += 0.05)
                {
                    for (double j = 0; j < 1.0; j += 0.05)
                    {
                        double u = domU[0] + i * (domU[1] - domU[0]);
                        double v = domV[0] + j * (domV[1] - domV[0]);
                        Rhino.Geometry.Point3d P;
                        Rhino.Geometry.Vector3d[] V;
                        leaf.srf.Evaluate(u, v, 0, out P, out V);
                        var newP = new Rhino.Geometry.Point3d(P.X, P.Y, globalFunc(P.X, P.Y));
                        targetSrf.Add(newP);
                    }
                }
            }
    }
Example #2
0
 public (long, error) Read(slice <byte> p) => s_ReadByRef?.Invoke(ref this, p) ?? s_ReadByVal?.Invoke(this, p) ?? Reader?.Read(p) ?? throw new PanicException(RuntimeErrorPanic.NilPointerDereference);
Example #3
0
 public lcaRange(slice <lcaRangeBlock> blocks = default, slice <slice <ID> > rangeMin = default)
 {
     this.blocks   = blocks;
     this.rangeMin = rangeMin;
 }
Example #4
0
 public StartElement(Name Name = default, slice <Attr> Attr = default)
 {
     this.Name = Name;
     this.Attr = Attr;
 }
Example #5
0
 private delegate(long, error) ReadByVal(T value, slice <byte> p);
 public VarsByOffset(slice <ptr <Var> > value) => m_value = value;
Example #7
0
 public deadcodePass(ref ptr <Link> ctxt = default, ref ptr <loader.Loader> ldr = default, workQueue wq = default, map <methodsig, bool> ifaceMethod = default, slice <methodref> markableMethods = default, bool reflectSeen = default)
 {
     this.ctxt            = ctxt;
     this.ldr             = ldr;
     this.wq              = wq;
     this.ifaceMethod     = ifaceMethod;
     this.markableMethods = markableMethods;
     this.reflectSeen     = reflectSeen;
 }
Example #8
0
File: gc.cs Project: zjmit/go2cs
 // MutatorUtilization returns a set of mutator utilization functions
 // for the given trace. Each function will always end with 0
 // utilization. The bounds of each function are implicit in the first
 // and last event; outside of these bounds each function is undefined.
 //
 // If the UtilPerProc flag is not given, this always returns a single
 // utilization function. Otherwise, it returns one function per P.
 public static slice<slice<MutatorUtil>> MutatorUtilization(slice<ptr<Event>> events, UtilFlags flags)
 {
     if (len(events) == 0L)
     {
         return null;
     }
Example #9
0
 private static uint archUpdateCastagnoli(uint crc, slice <byte> p) => func((_, panic, __) =>
 {
     panic("not available");
 });
Example #10
0
 public Location(ulong ID = default, ref ptr <Mapping> Mapping = default, ulong Address = default, slice <Line> Line = default, bool IsFolded = default, ulong mappingIDX = default)
 {
     this.ID         = ID;
     this.Mapping    = Mapping;
     this.Address    = Address;
     this.Line       = Line;
     this.IsFolded   = IsFolded;
     this.mappingIDX = mappingIDX;
 }
Example #11
0
 public serverHandshakeState(ref ptr <Conn> c = default, ref ptr <clientHelloMsg> clientHello = default, ref ptr <serverHelloMsg> hello = default, ref ptr <cipherSuite> suite = default, bool ecdheOk = default, bool ecSignOk = default, bool rsaDecryptOk = default, bool rsaSignOk = default, ref ptr <sessionState> sessionState = default, finishedHash finishedHash = default, slice <byte> masterSecret = default, ref ptr <Certificate> cert = default)
 {
     this.c            = c;
     this.clientHello  = clientHello;
     this.hello        = hello;
     this.suite        = suite;
     this.ecdheOk      = ecdheOk;
     this.ecSignOk     = ecSignOk;
     this.rsaDecryptOk = rsaDecryptOk;
     this.rsaSignOk    = rsaSignOk;
     this.sessionState = sessionState;
     this.finishedHash = finishedHash;
     this.masterSecret = masterSecret;
     this.cert         = cert;
 }
Example #12
0
 public Comments(slice <Comment> Before = default, slice <Comment> Suffix = default, slice <Comment> After = default)
 {
     this.Before = Before;
     this.Suffix = Suffix;
     this.After  = After;
 }
Example #13
0
                            // ToUnified takes a file contents and a sequence of edits, and calculates
                            // a unified diff that represents those edits.
                            public static Unified ToUnified(@string from, @string to, @string content, slice <TextEdit> edits)
                            {
                                Unified u = new Unified(From: from, To: to, );

                                if (len(edits) == 0L)
                                {
                                    return(u);
                                }

                                var(c, edits, partial) = prepareEdits(content, edits);
                                if (partial)
                                {
                                    edits = lineEdits(content, c, edits);
                                }

                                var        lines = splitLines(content);
                                ptr <Hunk> h;
                                long       last   = 0L;
                                long       toLine = 0L;

                                foreach (var(_, edit) in edits)
                                {
                                    var start = edit.Span.Start().Line() - 1L;
                                    var end   = edit.Span.End().Line() - 1L;

                                    if (h != null && start == last)
                                    {
                                        else if (h != null && start <= last + gap)
                                        {
                                            //within range of previous lines, add the joiners
                                            addEqualLines(h, lines, last, start);
                                        }
                                        else
                                        //need to start a new hunk
                                        if (h != null)
                                        {
                                            // add the edge to the previous hunk
                                            addEqualLines(h, lines, last, last + edge);
                                            u.Hunks = append(u.Hunks, h);
                                        }
                                    }

                                    toLine += start - last;
                                    h       = addr(new Hunk(FromLine: start + 1, ToLine: toLine + 1, ));
                                    // add the edge to the new hunk
                                    var delta = addEqualLines(h, lines, start - edge, start);
                                    h.FromLine -= delta;
                                    h.ToLine   -= delta;
                                    last        = start;
                                    for (var i = start; i < end; i++)
                                    {
                                        h.Lines = append(h.Lines, new Line(Kind: Delete, Content: lines[i]));
                                        last++;
                                    }

                                    if (edit.NewText != "")
                                    {
                                        foreach (var(_, line) in splitLines(edit.NewText))
                                        {
                                            h.Lines = append(h.Lines, new Line(Kind: Insert, Content: line));
                                            toLine++;
                                        }
                                    }
                                }
 public InterfaceAddrMessage(long Version = default, long Type = default, long Flags = default, long Index = default, slice <Addr> Addrs = default, slice <byte> raw = default)
 {
     this.Version = Version;
     this.Type    = Type;
     this.Flags   = Flags;
     this.Index   = Index;
     this.Addrs   = Addrs;
     this.raw     = raw;
 }
Example #15
0
 internal Subscript(IndexExpression expr, expr_context ctx)
     : this()
 {
     _value = Convert(expr.Target);
     _ctx = ctx;
     _slice = TrySliceConvert(expr.Index);
     if (_slice == null)
         _slice = new Index(Convert(expr.Index));
 }
Example #16
0
 { // for linkname
     //go:linkname sysctl syscall.sysctl
     private static error sysctl(slice <int> mib, ptr <byte> old, ptr <System.UIntPtr> oldlen, ptr <byte> @new, System.UIntPtr newlen)
     ;
Example #17
0
 public Progs(ref ptr <obj.Prog> Text = default, ref ptr <obj.Prog> next = default, long pc = default, src.XPos pos = default, ref ptr <Node> curfn = default, slice <obj.Prog> progcache = default, long cacheidx = default)
 {
     this.Text      = Text;
     this.next      = next;
     this.pc        = pc;
     this.pos       = pos;
     this.curfn     = curfn;
     this.progcache = progcache;
     this.cacheidx  = cacheidx;
 }
 public compilationUnitByStartPC(slice <ptr <sym.CompilationUnit> > value) => m_value = value;
Example #19
0
 public Exporter(sync.Mutex mu = default, slice <metric.Data> metrics = default)
 {
     this.mu      = mu;
     this.metrics = metrics;
 }
Example #20
0
 //go:noescape
 public static long IndexByte(slice <byte> b, byte c)
 ;
Example #21
0
 public LinkAddr(long Index = default, @string Name = default, slice <byte> Addr = default)
 {
     this.Index = Index;
     this.Name  = Name;
     this.Addr  = Addr;
 }
Example #22
0
 public Pass(ref ptr <Analyzer> Analyzer = default, ref ptr <token.FileSet> Fset = default, slice <ptr <ast.File> > Files = default, slice <@string> OtherFiles = default, ref ptr <types.Package> Pkg = default, ref ptr <types.Info> TypesInfo = default, types.Sizes TypesSizes = default, Action <Diagnostic> Report = default, Func <types.Object, Fact, bool> ImportObjectFact = default, Func <ptr <types.Package>, Fact, bool> ImportPackageFact = default, Action <types.Object, Fact> ExportObjectFact = default, Action <Fact> ExportPackageFact = default, Func <slice <PackageFact> > AllPackageFacts = default, Func <slice <ObjectFact> > AllObjectFacts = default, slice <types.Error> typeErrors = default)
 {
     this.Analyzer          = Analyzer;
     this.Fset              = Fset;
     this.Files             = Files;
     this.OtherFiles        = OtherFiles;
     this.Pkg               = Pkg;
     this.TypesInfo         = TypesInfo;
     this.TypesSizes        = TypesSizes;
     this.Report            = Report;
     this.ImportObjectFact  = ImportObjectFact;
     this.ImportPackageFact = ImportPackageFact;
     this.ExportObjectFact  = ExportObjectFact;
     this.ExportPackageFact = ExportPackageFact;
     this.AllPackageFacts   = AllPackageFacts;
     this.AllObjectFacts    = AllObjectFacts;
     this.typeErrors        = typeErrors;
 }
Example #23
0
 public DeclStmt(slice <Decl> DeclList = default, stmt stmt = default)
 {
     this.DeclList  = DeclList;
     this.m_stmtRef = new ptr <stmt>(stmt);
 }
Example #24
0
 public reader(bitReader br = default, uint fileCRC = default, uint blockCRC = default, uint wantBlockCRC = default, bool setupDone = default, long blockSize = default, bool eof = default, array <ulong> c = default, slice <uint> tt = default, uint tPos = default, slice <uint> preRLE = default, long preRLEUsed = default, long lastByte = default, ulong byteRepeats = default, ulong repeats = default)
 {
     this.br           = br;
     this.fileCRC      = fileCRC;
     this.blockCRC     = blockCRC;
     this.wantBlockCRC = wantBlockCRC;
     this.setupDone    = setupDone;
     this.blockSize    = blockSize;
     this.eof          = eof;
     this.c            = c;
     this.tt           = tt;
     this.tPos         = tPos;
     this.preRLE       = preRLE;
     this.preRLEUsed   = preRLEUsed;
     this.lastByte     = lastByte;
     this.byteRepeats  = byteRepeats;
     this.repeats      = repeats;
 }
Example #25
0
 private delegate(long, error) ReadByRef(ref T value, slice <byte> p);
 public x25519Parameters(slice <byte> privateKey = default, slice <byte> publicKey = default)
 {
     this.privateKey = privateKey;
     this.publicKey  = publicKey;
 }
Example #27
0
 public peBaseRelocBlock(slice <peBaseRelocEntry> entries = default)
 {
     this.entries = entries;
 }
Example #28
0
 public cbc(Block b = default, long blockSize = default, slice <byte> iv = default, slice <byte> tmp = default)
 {
     this.b         = b;
     this.blockSize = blockSize;
     this.iv        = iv;
     this.tmp       = tmp;
 }
 public stackProfile(slice <slice <System.UIntPtr> > value) => m_value = value;
Example #30
0
                                            private static void rangeMutex()
                                            {
                                                sync.Mutex mu = default;
                                                long       i  = default;

                                                slice <sync.Mutex> s = default;

                                                foreach (var(__i) in s)
                                                {
                                                    i = __i;
                                                }
                                                foreach (var(__i) in s)
                                                {
                                                    i = __i;
                                                }
                                                {
                                                    long i__prev1 = i;

                                                    foreach (var(__i) in s)
                                                    {
                                                        i = __i;
                                                    }
                                                    i = i__prev1;
                                                }

                                                foreach (var(__i, _) in s)
                                                {
                                                    i = __i;
                                                }
                                                {
                                                    long i__prev1 = i;

                                                    foreach (var(__i, _) in s)
                                                    {
                                                        i = __i;
                                                    }
                                                    i = i__prev1;
                                                }

                                                foreach (var(_, __mu) in s)
                                                {
                                                    mu = __mu; // want "range var mu copies lock: sync.Mutex"
                                                }
                                                {
                                                    var m__prev1 = m;

                                                    foreach (var(_, __m) in s)
                                                    {
                                                        m = __m; // want "range var m copies lock: sync.Mutex"
                                                    }
                                                    m = m__prev1;
                                                }

                                                foreach (var(__i, __mu) in s)
                                                {
                                                    i  = __i;
                                                    mu = __mu; // want "range var mu copies lock: sync.Mutex"
                                                }
                                                {
                                                    long i__prev1 = i;
                                                    var  m__prev1 = m;

                                                    foreach (var(__i, __m) in s)
                                                    {
                                                        i = __i;
                                                        m = __m; // want "range var m copies lock: sync.Mutex"
                                                    }
                                                    i = i__prev1;
                                                    m = m__prev1;
                                                }

                                                array <sync.Mutex> a = new array <sync.Mutex>(3L);
                                                {
                                                    var m__prev1 = m;

                                                    foreach (var(_, __m) in a)
                                                    {
                                                        m = __m; // want "range var m copies lock: sync.Mutex"
                                                    }
                                                    m = m__prev1;
                                                }

                                                map <sync.Mutex, sync.Mutex> m = default;

                                                {
                                                    var k__prev1 = k;

                                                    foreach (var(__k) in m)
                                                    {
                                                        k = __k; // want "range var k copies lock: sync.Mutex"
                                                    }
                                                    k = k__prev1;
                                                }

                                                foreach (var(__mu, _) in m)
                                                {
                                                    mu = __mu; // want "range var mu copies lock: sync.Mutex"
                                                }
                                                {
                                                    var k__prev1 = k;

                                                    foreach (var(__k, _) in m)
                                                    {
                                                        k = __k; // want "range var k copies lock: sync.Mutex"
                                                    }
                                                    k = k__prev1;
                                                }

                                                foreach (var(_, __mu) in m)
                                                {
                                                    mu = __mu; // want "range var mu copies lock: sync.Mutex"
                                                }
                                                {
                                                    var v__prev1 = v;

                                                    foreach (var(_, __v) in m)
                                                    {
                                                        v = __v; // want "range var v copies lock: sync.Mutex"
                                                    }
                                                    v = v__prev1;
                                                }

                                                channel <sync.Mutex> c = default;

                                                foreach (var(__mu) in c)
                                                {
                                                    mu = __mu;
                                                }
                                                foreach (var(__mu) in c)
                                                {
                                                    mu = __mu; // want "range var mu copies lock: sync.Mutex"
                                                }
                                                {
                                                    var v__prev1 = v;

                                                    foreach (var(__v) in c)
                                                    {
                                                        v = __v; // want "range var v copies lock: sync.Mutex"
                                                    }
                                                    v = v__prev1;
                                                }

                                                var t = default;

                                                foreach (var(__t.i, __t.mu) in s)
                                                {
                                                    t.i  = __t.i;
                                                    t.mu = __t.mu; // want "range var t.mu copies lock: sync.Mutex"
                                                }
                                            }
Example #31
0
 public Subscript( expr value, slice slice, expr_context ctx, 
     [Optional]int? lineno, [Optional]int? col_offset )
     : this()
 {
     _value = value;
     _slice = slice;
     _ctx = ctx;
     _lineno = lineno;
     _col_offset = col_offset;
 }
Example #32
0
 public TXTResource(slice <@string> TXT = default)
 {
     this.TXT = TXT;
 }
Example #33
0
            internal Subscript(IndexExpression expr, expr_context ctx)
                : this() {
                _value = Convert(expr.Target);
                AST index = Convert(expr.Index);
                if (index is expr)
                    if (index is Tuple && ((TupleExpression)expr.Index).IsExpandable)
                        _slice = new ExtSlice(((Tuple)index).elts);
                    else
                        _slice = new Index((expr)index);
                else if (index is slice) // includes Ellipsis
                    _slice = (slice)index;
                else
                    throw new ArgumentTypeException("Unexpected index expression: " + expr.Index.GetType());

                _ctx = ctx;
            }
Example #34
0
 public jsonPackage(@string ImportPath = default, @string Dir = default, @string Name = default, @string Export = default, slice <@string> GoFiles = default, slice <@string> CompiledGoFiles = default, slice <@string> CFiles = default, slice <@string> CgoFiles = default, slice <@string> CXXFiles = default, slice <@string> MFiles = default, slice <@string> HFiles = default, slice <@string> FFiles = default, slice <@string> SFiles = default, slice <@string> SwigFiles = default, slice <@string> SwigCXXFiles = default, slice <@string> SysoFiles = default, slice <@string> Imports = default, map <@string, @string> ImportMap = default, slice <@string> Deps = default, ref ptr <Module> Module = default, slice <@string> TestGoFiles = default, slice <@string> TestImports = default, slice <@string> XTestGoFiles = default, slice <@string> XTestImports = default, @string ForTest = default, bool DepOnly = default, ref ptr <jsonPackageError> Error = default)
 {
     this.ImportPath      = ImportPath;
     this.Dir             = Dir;
     this.Name            = Name;
     this.Export          = Export;
     this.GoFiles         = GoFiles;
     this.CompiledGoFiles = CompiledGoFiles;
     this.CFiles          = CFiles;
     this.CgoFiles        = CgoFiles;
     this.CXXFiles        = CXXFiles;
     this.MFiles          = MFiles;
     this.HFiles          = HFiles;
     this.FFiles          = FFiles;
     this.SFiles          = SFiles;
     this.SwigFiles       = SwigFiles;
     this.SwigCXXFiles    = SwigCXXFiles;
     this.SysoFiles       = SysoFiles;
     this.Imports         = Imports;
     this.ImportMap       = ImportMap;
     this.Deps            = Deps;
     this.Module          = Module;
     this.TestGoFiles     = TestGoFiles;
     this.TestImports     = TestImports;
     this.XTestGoFiles    = XTestGoFiles;
     this.XTestImports    = XTestImports;
     this.ForTest         = ForTest;
     this.DepOnly         = DepOnly;
     this.Error           = Error;
 }