/// <summary> /// 空のグラフを生成する /// </summary> /// <param name="graphFlags">生成したグラフのタイプ.無向グラフの場合,CV_SEQ_KIND_GRAPH,有向グラフの場合,CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED. </param> /// <param name="headerSize">グラフのヘッダサイズ (sizeof(CvGraph)以上)</param> /// <param name="vtxSize">グラフの頂点サイズ</param> /// <param name="edgeSize">グラフの辺サイズ</param> /// <param name="storage">グラフコンテナ</param> #else /// <summary> /// Creates empty graph /// </summary> /// <param name="graphFlags">Type of the created graph. Usually, it is either CV_SEQ_KIND_GRAPH for generic unoriented graphs and CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED for generic oriented graphs. </param> /// <param name="headerSize">Graph header size; may not be less than sizeof(CvGraph).</param> /// <param name="vtxSize">Graph vertex size; the custom vertex structure must start with CvGraphVtx (use CV_GRAPH_VERTEX_FIELDS()) </param> /// <param name="edgeSize">Graph edge size; the custom edge structure must start with CvGraphEdge (use CV_GRAPH_EDGE_FIELDS()) </param> /// <param name="storage">The graph container. </param> /// <remarks>The function cvCreateGraph creates an empty graph and returns it.</remarks> #endif public CvGraph(SeqType graphFlags, int vtxSize, int edgeSize, CvMemStorage storage, int headerSize) { if (storage == null) throw new ArgumentNullException(); IntPtr p = NativeMethods.cvCreateGraph(graphFlags, headerSize, vtxSize, edgeSize, storage.CvPtr); Initialize(p); holdingStorage = storage; }
public TypeApply Compile_SeqType(SeqType t) { Dictionary <TypeParameter, Type> typeArgs = new Dictionary <TypeParameter, Type>(); DatatypeDecl decl = FindDatatype("Seq"); return(Compile_Datatype(new UserDefinedType(Bpl.Token.NoToken, "Seq", decl, new List <Type> { t.Arg }))); }
/// <summary> /// 空のセットを生成する /// </summary> /// <param name="setFlags">生成するセットのタイプ. </param> /// <param name="headerSize">セットのヘッダのサイズ(sizeof(CvSet)以上). </param> /// <param name="elemSize">セットの要素のサイズ(CvSetElem 以上). </param> /// <param name="storage">セットのためのコンテナ. </param> #else /// <summary> /// Creates empty set /// </summary> /// <param name="setFlags">Type of the created set. </param> /// <param name="headerSize">Set header size; may not be less than sizeof(CvSet). </param> /// <param name="elemSize">Set element size; may not be less than CvSetElem. </param> /// <param name="storage">Container for the set. </param> #endif public CvSet(SeqType setFlags, int headerSize, int elemSize, CvMemStorage storage) { if (storage == null) throw new ArgumentNullException(); IntPtr p = NativeMethods.cvCreateSet(setFlags, headerSize, elemSize, storage.CvPtr); Initialize(p); holdingStorage = storage; }
public string TypeString(Type t) { t = ToType(t); MapType mt = t as MapType; UserDefinedType ut = t as UserDefinedType; SeqType seq = t as SeqType; if (t is BoolType) { return("bool"); } else if (t is IntType) { return("int"); } else if (t is RealType) { return("real"); } else if (mt != null) { return("[" + TypeString(mt.Domain) + "]" + TypeString(mt.Range)); } else if (ut != null && ut.AsDatatype != null) { return(Compile_Datatype(ut).AppName()); } else if (ut != null && ut.Name == "array") { if (!(ToType(ut.TypeArgs[0]) is IntType) || ToType(ut.TypeArgs[0]) is NatType) { throw new Exception("not implemented: arrays of non-int types: " + ToType(ut.TypeArgs[0])); } return("ArrayOfInt"); } else if (ut != null && ut.Name == "INTERNAL_AbsMem") { return("[int][int]int"); } else if (ut != null && ut.Name == "INTERNAL_ArrayElems") { return("[int]int"); } else if (ut != null && !ut.IsTypeParameter) { return(ut.Name); } else if (seq != null) { return(Compile_SeqType(seq).AppName()); } else { throw new Exception("not implemented: " + t + ": " + t.GetType()); } }
/// <summary> /// 空のセットを生成する /// </summary> /// <param name="set_flags">生成するセットのタイプ. </param> /// <param name="header_size">セットのヘッダのサイズ(sizeof(CvSet)以上). </param> /// <param name="elem_size">セットの要素のサイズ(CvSetElem 以上). </param> /// <param name="storage">セットのためのコンテナ. </param> #else /// <summary> /// Creates empty set /// </summary> /// <param name="set_flags">Type of the created set. </param> /// <param name="header_size">Set header size; may not be less than sizeof(CvSet). </param> /// <param name="elem_size">Set element size; may not be less than CvSetElem. </param> /// <param name="storage">Container for the set. </param> #endif public CvSet(SeqType set_flags, int header_size, int elem_size, CvMemStorage storage) { if (storage == null) { throw new ArgumentNullException(); } IntPtr ptr = CvInvoke.cvCreateSet(set_flags, header_size, elem_size, storage.CvPtr); Initialize(ptr); this._storage = storage; }
/// <summary> /// 配列からインスタンスを生成する /// </summary> /// <param name="array">IEnumerableインタフェースを実装するオブジェクト。ArrayやList<t>など。</param> /// <param name="seqFlags">生成されたシーケンスのフラグ</param> /// <param name="storage">シーケンスが保存される場所</param> /// <returns>CvSeq<t></returns> #else /// <summary> /// Creates CvSeq<t> from an IEnumerable<t> instance (ex. Array, List<t>) /// </summary> /// <param name="array">IEnumerable<t> instance</param> /// <param name="seqFlags">Flags of the created sequence</param> /// <param name="storage">Sequence location</param> /// <returns>CvSeq<t></returns> #endif public static CvSeq <T> FromArray(IEnumerable <T> array, SeqType seqFlags, CvMemStorage storage) { CvSeq <T> seq = new CvSeq <T>(seqFlags, storage); foreach (var item in array) { Cv.SeqPush(seq, item); } return(seq); }
/// <summary> /// 空のグラフを生成する /// </summary> /// <param name="graph_flags">生成したグラフのタイプ.無向グラフの場合,CV_SEQ_KIND_GRAPH,有向グラフの場合,CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED. </param> /// <param name="header_size">グラフのヘッダサイズ (sizeof(CvGraph)以上)</param> /// <param name="vtx_size">グラフの頂点サイズ</param> /// <param name="edge_size">グラフの辺サイズ</param> /// <param name="storage">グラフコンテナ</param> #else /// <summary> /// Creates empty graph /// </summary> /// <param name="graph_flags">Type of the created graph. Usually, it is either CV_SEQ_KIND_GRAPH for generic unoriented graphs and CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED for generic oriented graphs. </param> /// <param name="header_size">Graph header size; may not be less than sizeof(CvGraph).</param> /// <param name="vtx_size">Graph vertex size; the custom vertex structure must start with CvGraphVtx (use CV_GRAPH_VERTEX_FIELDS()) </param> /// <param name="edge_size">Graph edge size; the custom edge structure must start with CvGraphEdge (use CV_GRAPH_EDGE_FIELDS()) </param> /// <param name="storage">The graph container. </param> /// <remarks>The function cvCreateGraph creates an empty graph and returns it.</remarks> #endif public CvGraph(SeqType graph_flags, int vtx_size, int edge_size, CvMemStorage storage, int header_size) { if (storage == null) { throw new ArgumentNullException(); } IntPtr ptr = CvInvoke.cvCreateGraph(graph_flags, header_size, vtx_size, edge_size, storage.CvPtr); Initialize(ptr); this._storage = storage; }
/// <summary> /// 新しいシーケンスを作成し,ライタ(writer)を初期化する (cvStartWriteSeq). /// </summary> /// <param name="seqFlags">作成されたシーケンスのフラグ. 生成されたシーケンスが,特定のシーケンスタイプを引数にとるような関数に一切渡されない場合は,この値に0を指定してもかまわない. そうでない場合は,定義済みのシーケンスタイプのリストから適切なタイプが選択されなければならない. </param> /// <param name="headerSize">シーケンスヘッダのサイズ.sizeof(CvSeq)以上でなければならない. また,特別なタイプか拡張が指示されている場合,そのタイプは基本タイプのヘッダサイズと合致しなければならない. </param> /// <param name="elemSize">シーケンスの要素サイズ(バイト単位).サイズはシーケンスタイプと合致しなければならない. 例えば,点群のシーケンス(要素タイプは CV_SEQ_ELTYPE_POINT)を作成する場合, パラメータ elem_size は sizeof(CvPoint) と等しくなければならない. </param> /// <param name="storage">シーケンスの位置. </param> #else /// <summary> /// Creates new sequence and initializes writer for it (cvStartWriteSeq). /// </summary> /// <param name="seqFlags">Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be equal to 0, otherwise the appropriate type must be selected from the list of predefined sequence types. </param> /// <param name="headerSize">Size of the sequence header. The parameter value may not be less than sizeof(CvSeq). If a certain type or extension is specified, it must fit the base type header. </param> /// <param name="elemSize">Size of the sequence elements in bytes; must be consistent with the sequence type. For example, if the sequence of points is created (element type CV_SEQ_ELTYPE_POINT ), then the parameter elem_size must be equal to sizeof(CvPoint). </param> /// <param name="storage">Sequence location. </param> #endif public CvSeqWriter(SeqType seqFlags, int headerSize, int elemSize, CvMemStorage storage) : this() { if (storage == null) { throw new ArgumentNullException(nameof(storage)); } NativeMethods.cvStartWriteSeq(seqFlags, headerSize, elemSize, storage.CvPtr, ptr); }
/// <summary> /// 空のグラフを生成する /// </summary> /// <param name="graphFlags">生成したグラフのタイプ.無向グラフの場合,CV_SEQ_KIND_GRAPH,有向グラフの場合,CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED. </param> /// <param name="headerSize">グラフのヘッダサイズ (sizeof(CvGraph)以上)</param> /// <param name="vtxSize">グラフの頂点サイズ</param> /// <param name="edgeSize">グラフの辺サイズ</param> /// <param name="storage">グラフコンテナ</param> #else /// <summary> /// Creates empty graph /// </summary> /// <param name="graphFlags">Type of the created graph. Usually, it is either CV_SEQ_KIND_GRAPH for generic unoriented graphs and CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED for generic oriented graphs. </param> /// <param name="headerSize">Graph header size; may not be less than sizeof(CvGraph).</param> /// <param name="vtxSize">Graph vertex size; the custom vertex structure must start with CvGraphVtx (use CV_GRAPH_VERTEX_FIELDS()) </param> /// <param name="edgeSize">Graph edge size; the custom edge structure must start with CvGraphEdge (use CV_GRAPH_EDGE_FIELDS()) </param> /// <param name="storage">The graph container. </param> /// <remarks>The function cvCreateGraph creates an empty graph and returns it.</remarks> #endif public CvGraph(SeqType graphFlags, int vtxSize, int edgeSize, CvMemStorage storage, int headerSize) { if (storage == null) { throw new ArgumentNullException(); } IntPtr p = NativeMethods.cvCreateGraph(graphFlags, headerSize, vtxSize, edgeSize, storage.CvPtr); Initialize(p); holdingStorage = storage; }
/// <summary> /// シーケンスを生成する /// </summary> /// <param name="seqFlags">生成されたシーケンスのフラグ.生成されたシーケンスが,特定のシーケンスタイプを引数にとるような関数に一切渡されない場合は,この値に0を指定してもかまわない.そうでない場合は,定義済みのシーケンスタイプのリストから適切なタイプが選択されなければならない.</param> /// <param name="headerSize">シーケンスのヘッダサイズ.sizeof(CvSeq)以上でなければならない. また,特別なタイプかその拡張が指示されている場合,そのタイプは基本タイプのヘッダと合致していなければならない.</param> /// <param name="elemSize">シーケンスの要素サイズ(バイト単位).サイズはシーケンスタイプと合致しなければならない.例えば,点群のシーケンスを作成する場合,要素タイプにCV_SEQ_ELTYPE_POINTを指定し,パラメータ elem_size は sizeof(CvPoint) と等しくなければならない.</param> /// <param name="storage">シーケンスが保存される場所</param> #else /// <summary> /// Creates sequence /// </summary> /// <param name="seqFlags">Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types. </param> /// <param name="headerSize">Size of the sequence header; must be greater or equal to sizeof(CvSeq). If a specific type or its extension is indicated, this type must fit the base type header. </param> /// <param name="elemSize">Size of the sequence elements in bytes. The size must be consistent with the sequence type. For example, for a sequence of points to be created, the element type CV_SEQ_ELTYPE_POINT should be specified and the parameter elem_size must be equal to sizeof(CvPoint). </param> /// <param name="storage">Sequence location. </param> #endif public CvSeq(SeqType seqFlags, int headerSize, int elemSize, CvMemStorage storage) { if (storage == null) { throw new ArgumentNullException(); } IntPtr p = NativeMethods.cvCreateSeq(seqFlags, headerSize, elemSize, storage.CvPtr); Initialize(p); holdingStorage = storage; }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnDoc)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(new XSString(), SeqType.OCC_QMARK); _expected_args.Add(arg); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnNamespaceUriFromQName)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(new QName(), SeqType.OCC_QMARK); _expected_args.Add(arg); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnInScopePrefixes)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(new ElementType(), SeqType.OCC_PLUS); _expected_args.Add(arg); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnLocalName)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(SeqType.OCC_QMARK); _expected_args.Add(arg); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnResolveQName)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(new XSString(), SeqType.OCC_QMARK); _expected_args.Add(arg); _expected_args.Add(new SeqType(new ElementType(), SeqType.OCC_NONE)); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(FnIDREF)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType arg = new SeqType(new XSString(), SeqType.OCC_STAR); _expected_args.Add(arg); _expected_args.Add(new SeqType(SeqType.OCC_NONE)); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(OpTo)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType st = new SeqType(new XSInteger()); _expected_args.Add(st); _expected_args.Add(st); } return(_expected_args); } }
/// <summary> /// Obtain a list of expected arguments. /// </summary> /// <returns> Result of operation. </returns> public static ICollection expected_args() { lock (typeof(OpUnion)) { if (_expected_args == null) { _expected_args = new ArrayList(); SeqType st = new SeqType(SeqType.OCC_STAR); _expected_args.Add(st); _expected_args.Add(st); } return(_expected_args); } }
public bool TrustedType(Type t) { SeqType seq = t as SeqType; UserDefinedType ut = t as UserDefinedType; if (seq != null) { return(TrustedType(seq.Arg)); } else if (ut != null) { return(IsSpecFile(ut.AsDatatype.tok.filename) && TrustedType(ut.TypeArgs)); } else { return(true); } }
void OnSeqTypeChanged(string val) { if (!inTheForest) { switch (val) { case "free": { seqType = SeqType.free; if (cursorLine.position.z == StartCursorPos) { cursorLine.position = Vector3.zero; } StartCursorPos = 0; } break; case "accident": { seqType = SeqType.accident; if (cursorLine.position.z == StartCursorPos) { cursorLine.position = new Vector3(0, 0, 18); } StartCursorPos = 18; } break; case "trafficlight": { seqType = SeqType.trafficlight; if (cursorLine.position.z == StartCursorPos) { cursorLine.position = new Vector3(0, 0, 7); } StartCursorPos = 7; } break; } SpawnAttributes(); ChangePos(); } }
public static extern IntPtr cvMakeSeqHeaderForArray(SeqType seq_type, int header_size, int elem_size, IntPtr elements, int total, IntPtr seq, IntPtr block);
public static extern void cvStartWriteSeq(SeqType seq_flags, int header_size, int elem_size, IntPtr storage, IntPtr writer);
public TypeApply Compile_SeqType(SeqType t) { Dictionary<TypeParameter,Type> typeArgs = new Dictionary<TypeParameter,Type>(); DatatypeDecl decl = FindDatatype("Seq"); return Compile_Datatype(new UserDefinedType(Bpl.Token.NoToken, "Seq", decl, new List<Type> { t.Arg })); }
public static extern IntPtr cvCreateSet(SeqType set_flags, int header_size, int elem_size, IntPtr storage);
/// <summary> /// 新しいシーケンスを作成し,ライタ(writer)を初期化する (cvStartWriteSeq). /// </summary> /// <param name="seq_flags">作成されたシーケンスのフラグ. 生成されたシーケンスが,特定のシーケンスタイプを引数にとるような関数に一切渡されない場合は,この値に0を指定してもかまわない. そうでない場合は,定義済みのシーケンスタイプのリストから適切なタイプが選択されなければならない. </param> /// <param name="header_size">シーケンスヘッダのサイズ.sizeof(CvSeq)以上でなければならない. また,特別なタイプか拡張が指示されている場合,そのタイプは基本タイプのヘッダサイズと合致しなければならない. </param> /// <param name="elem_size">シーケンスの要素サイズ(バイト単位).サイズはシーケンスタイプと合致しなければならない. 例えば,点群のシーケンス(要素タイプは CV_SEQ_ELTYPE_POINT)を作成する場合, パラメータ elem_size は sizeof(CvPoint) と等しくなければならない. </param> /// <param name="storage">シーケンスの位置. </param> #else /// <summary> /// Creates new sequence and initializes writer for it (cvStartWriteSeq). /// </summary> /// <param name="seq_flags">Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be equal to 0, otherwise the appropriate type must be selected from the list of predefined sequence types. </param> /// <param name="header_size">Size of the sequence header. The parameter value may not be less than sizeof(CvSeq). If a certain type or extension is specified, it must fit the base type header. </param> /// <param name="elem_size">Size of the sequence elements in bytes; must be consistent with the sequence type. For example, if the sequence of points is created (element type CV_SEQ_ELTYPE_POINT ), then the parameter elem_size must be equal to sizeof(CvPoint). </param> /// <param name="storage">Sequence location. </param> #endif public CvSeqWriter(SeqType seq_flags, int header_size, int elem_size, CvMemStorage storage) : base(seq_flags, header_size, elem_size, storage) { }
public void LoadFrom(ProcessLayer pl) { if (pl == this) return; this.c_active = pl.c_active; this.c_bailout = pl.c_bailout; this.c_calc = pl.c_calc; this.c_checkseqtype = pl.c_checkseqtype; this.c_checktype = pl.c_checktype; this.c_cmean = pl.c_cmean; this.c_convchktype = pl.c_convchktype; this.c_cvariance = pl.c_cvariance; this.c_cvarsx = pl.c_cvarsx; this.c_default = pl.c_default; this.c_isin = pl.c_isin; this.c_n = pl.c_n; this.c_nlimit = pl.c_nlimit; this.c_old2x = pl.c_old2x; this.c_oldx = pl.c_oldx; this.c_orbittraptype = pl.c_orbittraptype; this.c_pointA = pl.c_pointA; this.c_pointB = pl.c_pointB; this.c_resn = pl.c_resn; this.c_resx = pl.c_resx; this.c_seqtype = pl.c_seqtype; this.c_x = pl.c_x; }
void TypeAndToken(out IToken tok, out Type ty) { Contract.Ensures(Contract.ValueAtReturn(out tok)!=null); Contract.Ensures(Contract.ValueAtReturn(out ty) != null); tok = Token.NoToken; ty = new BoolType(); /*keep compiler happy*/ List<Type> gt; List<Type> tupleArgTypes = null; switch (la.kind) { case 6: { Get(); tok = t; break; } case 7: { Get(); tok = t; ty = new CharType(); break; } case 9: { Get(); tok = t; ty = new NatType(); break; } case 8: { Get(); tok = t; ty = new IntType(); break; } case 10: { Get(); tok = t; ty = new RealType(); break; } case 11: { Get(); tok = t; ty = new ObjectType(); break; } case 13: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count > 1) { SemErr("set type expects only one type argument"); } ty = new SetType(true, gt.Count == 1 ? gt[0] : null); break; } case 14: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count > 1) { SemErr("set type expects only one type argument"); } ty = new SetType(false, gt.Count == 1 ? gt[0] : null); break; } case 15: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count > 1) { SemErr("multiset type expects only one type argument"); } ty = new MultiSetType(gt.Count == 1 ? gt[0] : null); break; } case 16: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count > 1) { SemErr("seq type expects only one type argument"); } ty = new SeqType(gt.Count == 1 ? gt[0] : null); break; } case 12: { Get(); tok = t; ty = new UserDefinedType(tok, tok.val, null); break; } case 17: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count == 0) { ty = new MapType(true, null, null); } else if (gt.Count != 2) { SemErr("map type expects two type arguments"); ty = new MapType(true, gt[0], gt.Count == 1 ? new InferredTypeProxy() : gt[1]); } else { ty = new MapType(true, gt[0], gt[1]); } break; } case 18: { Get(); tok = t; gt = new List<Type>(); if (la.kind == 52) { GenericInstantiation(gt); } if (gt.Count == 0) { ty = new MapType(false, null, null); } else if (gt.Count != 2) { SemErr("imap type expects two type arguments"); ty = new MapType(false, gt[0], gt.Count == 1 ? new InferredTypeProxy() : gt[1]); } else { ty = new MapType(false, gt[0], gt[1]); } break; } case 5: { Get(); tok = t; gt = null; if (la.kind == 52) { gt = new List<Type>(); GenericInstantiation(gt); } int dims = tok.val.Length == 5 ? 1 : int.Parse(tok.val.Substring(5)); ty = theBuiltIns.ArrayType(tok, dims, gt, true); break; } case 50: { Get(); tok = t; tupleArgTypes = new List<Type>(); if (StartOf(3)) { Type(out ty); tupleArgTypes.Add(ty); while (la.kind == 22) { Get(); Type(out ty); tupleArgTypes.Add(ty); } } Expect(51); if (tupleArgTypes.Count == 1) { // just return the type 'ty' } else { var dims = tupleArgTypes.Count; var tmp = theBuiltIns.TupleType(tok, dims, true); // make sure the tuple type exists ty = new UserDefinedType(tok, BuiltIns.TupleTypeName(dims), dims == 0 ? null : tupleArgTypes); } break; } case 1: { Expression e; tok = t; NameSegmentForTypeName(out e); tok = t; while (la.kind == 27) { Get(); Expect(1); tok = t; List<Type> typeArgs = null; if (la.kind == 52) { typeArgs = new List<Type>(); GenericInstantiation(typeArgs); } e = new ExprDotName(tok, e, tok.val, typeArgs); } ty = new UserDefinedType(e.tok, e); break; } default: SynErr(164); break; } if (la.kind == 30) { Type t2; Get(); tok = t; Type(out t2); if (tupleArgTypes != null) { gt = tupleArgTypes; } else { gt = new List<Type>{ ty }; } ty = new ArrowType(tok, gt, t2); theBuiltIns.CreateArrowTypeDecl(gt.Count); } }
public ProcessLayer(double bailout, ConvCheck convchktype, int nlimit, SeqType seqtype, SeqCheck checktype, SeqType checkseqtype, Complex pointA = default(Complex), Complex pointB = default(Complex), OrbitTrap orbittraptype = OrbitTrap.MPL_ORBIT_TRAP_POINT) { c_bailout = bailout; c_convchktype = convchktype; c_nlimit = nlimit; c_active = false; c_default = false; c_isin = false; c_seqtype = seqtype; c_x = 0; c_checktype = checktype; c_checkseqtype = checkseqtype; c_n = 0; c_calc = 0; c_resx = 0; c_orbittraptype = orbittraptype; c_pointA = pointA; c_pointB = pointB; }
void TypeAndToken(out IToken tok, out Type ty, bool inExpressionContext) { Contract.Ensures(Contract.ValueAtReturn(out tok)!=null); Contract.Ensures(Contract.ValueAtReturn(out ty) != null); tok = Token.NoToken; ty = new BoolType(); /*keep compiler happy*/ List<Type> gt; List<Type> tupleArgTypes = null; switch (la.kind) { case 7: { Get(); tok = t; break; } case 8: { Get(); tok = t; ty = new CharType(); break; } case 9: { Get(); tok = t; ty = new IntType(); break; } case 10: { Get(); tok = t; ty = new UserDefinedType(tok, tok.val, null); break; } case 11: { Get(); tok = t; ty = new RealType(); break; } case 6: { Get(); tok = t; int w = StringToInt(tok.val.Substring(2), 0, "bitvectors that wide"); ty = new BitvectorType(w); break; } case 12: { Get(); tok = t; ty = new ObjectType(); break; } case 14: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt != null && gt.Count > 1) { SemErr("set type expects only one type argument"); } ty = new SetType(true, gt != null ?gt[0] : null); break; } case 15: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt != null && gt.Count > 1) { SemErr("set type expects only one type argument"); } ty = new SetType(false, gt != null ? gt[0] : null); break; } case 16: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt != null && gt.Count > 1) { SemErr("multiset type expects only one type argument"); } ty = new MultiSetType(gt != null ? gt[0] : null); break; } case 17: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt != null && gt.Count > 1) { SemErr("seq type expects only one type argument"); } ty = new SeqType(gt != null ? gt[0] : null); break; } case 13: { Get(); tok = t; ty = new UserDefinedType(tok, tok.val, null); break; } case 18: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt == null) { ty = new MapType(true, null, null); } else if (gt.Count != 2) { SemErr("map type expects two type arguments"); ty = new MapType(true, gt[0], gt.Count == 1 ? new InferredTypeProxy() : gt[1]); } else { ty = new MapType(true, gt[0], gt[1]); } break; } case 19: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); if (gt == null) { ty = new MapType(false, null, null); } else if (gt.Count != 2) { SemErr("imap type expects two type arguments"); ty = new MapType(false, gt[0], gt.Count == 1 ? new InferredTypeProxy() : gt[1]); } else { ty = new MapType(false, gt[0], gt[1]); } break; } case 5: { Get(); tok = t; OptGenericInstantiation(out gt, inExpressionContext); int dims = StringToInt(tok.val.Substring(5), 1, "arrays of that many dimensions"); ty = theBuiltIns.ArrayType(tok, dims, gt, true); break; } case 54: { Get(); tok = t; tupleArgTypes = new List<Type>(); if (StartOf(6)) { Type(out ty); tupleArgTypes.Add(ty); while (la.kind == 23) { Get(); Type(out ty); tupleArgTypes.Add(ty); } } Expect(55); if (tupleArgTypes.Count == 1) { // just return the type 'ty' } else { var dims = tupleArgTypes.Count; var tmp = theBuiltIns.TupleType(tok, dims, true); // make sure the tuple type exists ty = new UserDefinedType(tok, BuiltIns.TupleTypeName(dims), dims == 0 ? null : tupleArgTypes); } break; } case 1: { Expression e; NameSegmentForTypeName(out e, inExpressionContext); tok = t; while (la.kind == 28) { Get(); Expect(1); tok = t; List<Type> typeArgs; OptGenericInstantiation(out typeArgs, inExpressionContext); e = new ExprDotName(tok, e, tok.val, typeArgs); } ty = new UserDefinedType(e.tok, e); break; } default: SynErr(182); break; } if (IsArrow()) { Expect(32); tok = t; Type t2; Type(out t2); if (tupleArgTypes != null) { gt = tupleArgTypes; } else { gt = new List<Type>{ ty }; } ty = new ArrowType(tok, gt, t2); theBuiltIns.CreateArrowTypeDecl(gt.Count); } }
/// <summary> /// シーケンスを生成する /// </summary> /// <param name="seqFlags">生成されたシーケンスのフラグ.生成されたシーケンスが,特定のシーケンスタイプを引数にとるような関数に一切渡されない場合は,この値に0を指定してもかまわない.そうでない場合は,定義済みのシーケンスタイプのリストから適切なタイプが選択されなければならない.</param> /// <param name="headerSize">シーケンスのヘッダサイズ.sizeof(CvSeq)以上でなければならない. また,特別なタイプかその拡張が指示されている場合,そのタイプは基本タイプのヘッダと合致していなければならない.</param> /// <param name="storage">シーケンスが保存される場所</param> #else /// <summary> /// Creates sequence /// </summary> /// <param name="seqFlags">Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types. </param> /// <param name="headerSize">Size of the sequence header; must be greater or equal to sizeof(CvSeq). If a specific type or its extension is indicated, this type must fit the base type header. </param> /// <param name="storage">Sequence location. </param> #endif public CvSeq(SeqType seqFlags, int headerSize, CvMemStorage storage) : base(seqFlags, headerSize, Util.SizeOf(typeof(T)), storage) { }
/// <summary> /// シーケンスを生成する. header_size=sizeof(CvSeq) /// </summary> /// <param name="seqFlags">生成されたシーケンスのフラグ.生成されたシーケンスが,特定のシーケンスタイプを引数にとるような関数に一切渡されない場合は,この値に0を指定してもかまわない.そうでない場合は,定義済みのシーケンスタイプのリストから適切なタイプが選択されなければならない.</param> /// <param name="elemSize">シーケンスの要素サイズ(バイト単位).サイズはシーケンスタイプと合致しなければならない.例えば,点群のシーケンスを作成する場合,要素タイプにCV_SEQ_ELTYPE_POINTを指定し,パラメータ elem_size は sizeof(CvPoint) と等しくなければならない.</param> /// <param name="storage">シーケンスが保存される場所</param> /// <returns></returns> #else /// <summary> /// Creates sequence. header_size=sizeof(CvSeq) /// </summary> /// <param name="seqFlags">Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types. </param> /// <param name="elemSize">Size of the sequence elements in bytes. The size must be consistent with the sequence type. For example, for a sequence of points to be created, the element type CV_SEQ_ELTYPE_POINT should be specified and the parameter elem_size must be equal to sizeof(CvPoint). </param> /// <param name="storage">Sequence location. </param> /// <returns></returns> #endif public CvSeq(SeqType seqFlags, int elemSize, CvMemStorage storage) : this(seqFlags, SizeOf, elemSize, storage) { }
// ゲームオーバー関数 // tips... プレイヤー側が呼ぶ void GameOver() { // シーケンスをゲームオーバーに遷移させ、ゲームオーバー演出関数を開始させる seq = SeqType.SEQ_GAMEOVER; StartCoroutine("GameoverDirection"); }
// convert argument according to section 3.1.5 of xpath 2.0 spec /// <summary> /// Convert the input argument according to section 3.1.5 of specification. /// </summary> /// <param name="arg"> /// input argument. </param> /// <param name="expected"> /// Expected Sequence type. </param> /// <exception cref="DynamicError"> /// Dynamic error. </exception> /// <returns> Converted argument. </returns> public static org.eclipse.wst.xml.xpath2.api.ResultSequence convert_argument(org.eclipse.wst.xml.xpath2.api.ResultSequence arg, SeqType expected) { ResultBuffer result = new ResultBuffer(); // XXX: Should use type_class instead and use item.getClass().isAssignableTo(expected.type_class()) AnyType expected_type = expected.type(); // expected is atomic if (expected_type is AnyAtomicType) { AnyAtomicType expected_aat = (AnyAtomicType)expected_type; // atomize org.eclipse.wst.xml.xpath2.api.ResultSequence rs = FnData.atomize(arg); // cast untyped to expected type for (var i = rs.iterator(); i.MoveNext();) { AnyType item = (AnyType)i.Current; if (item is XSUntypedAtomic) { // create a new item of the expected // type initialized with from the string // value of the item ResultSequence converted = null; if (expected_aat is XSString) { XSString strType = new XSString(item.StringValue); converted = ResultSequenceFactory.create_new(strType); } else { converted = ResultSequenceFactory.create_new(item); } result.concat(converted); } // xs:anyURI promotion to xs:string else if (item is XSAnyURI && expected_aat is XSString) { result.add(new XSString(item.StringValue)); } // numeric type promotion else if (item is NumericType) { if (expected_aat is XSDouble) { XSDouble doubleType = new XSDouble(item.StringValue); result.add(doubleType); } else { result.add(item); } } else { result.add(item); } } // do sequence type matching on converted arguments return(expected.match(result.Sequence)); } else { // do sequence type matching on converted arguments return(expected.match(arg)); } }
/// <summary> /// 空のグラフを生成する /// </summary> /// <param name="graphFlags">生成したグラフのタイプ.無向グラフの場合,CV_SEQ_KIND_GRAPH,有向グラフの場合,CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED. </param> /// <param name="vtxSize">グラフのヘッダサイズ (sizeof(CvGraph)以上)</param> /// <param name="edgeSize">グラフの頂点サイズ</param> /// <param name="storage">グラフの辺サイズ</param> #else /// <summary> /// Creates empty graph /// </summary> /// <param name="graphFlags">Type of the created graph. Usually, it is either CV_SEQ_KIND_GRAPH for generic unoriented graphs and CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED for generic oriented graphs. </param> /// <param name="vtxSize">Graph vertex size; the custom vertex structure must start with CvGraphVtx (use CV_GRAPH_VERTEX_FIELDS()) </param> /// <param name="edgeSize">Graph edge size; the custom edge structure must start with CvGraphEdge (use CV_GRAPH_EDGE_FIELDS()) </param> /// <param name="storage">The graph container. </param> /// <remarks>The function cvCreateGraph creates an empty graph and returns it.</remarks> #endif public CvGraph(SeqType graphFlags, int vtxSize, int edgeSize, CvMemStorage storage) : this(graphFlags, vtxSize, edgeSize, storage, CvGraph.SizeOf) { }
/// <summary> /// 空のグラフを生成する /// </summary> /// <param name="graph_flags">生成したグラフのタイプ.無向グラフの場合,CV_SEQ_KIND_GRAPH,有向グラフの場合,CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED. </param> /// <param name="vtx_size">グラフのヘッダサイズ (sizeof(CvGraph)以上)</param> /// <param name="edge_size">グラフの頂点サイズ</param> /// <param name="storage">グラフの辺サイズ</param> #else /// <summary> /// Creates empty graph /// </summary> /// <param name="graph_flags">Type of the created graph. Usually, it is either CV_SEQ_KIND_GRAPH for generic unoriented graphs and CV_SEQ_KIND_GRAPH | CV_GRAPH_FLAG_ORIENTED for generic oriented graphs. </param> /// <param name="vtx_size">Graph vertex size; the custom vertex structure must start with CvGraphVtx (use CV_GRAPH_VERTEX_FIELDS()) </param> /// <param name="edge_size">Graph edge size; the custom edge structure must start with CvGraphEdge (use CV_GRAPH_EDGE_FIELDS()) </param> /// <param name="storage">The graph container. </param> /// <remarks>The function cvCreateGraph creates an empty graph and returns it.</remarks> #endif public CvGraph(SeqType graph_flags, int vtx_size, int edge_size, CvMemStorage storage) : this(graph_flags, vtx_size, edge_size, storage, CvGraph.SizeOf) { }
// スタート演出関数 private IEnumerator StartDirection() { // スタート演出オブジェクトその1を生成し、指定秒数分待機 Instantiate(start1, start1.transform.position, transform.rotation); yield return new WaitForSeconds(start1_wait_time); // スタート演出オブジェクトその2を生成し、指定秒数分待機 Instantiate(start2, start2.transform.position, transform.rotation); yield return new WaitForSeconds(start2_wait_time); // シーケンスをプレイに遷移 seq = SeqType.SEQ_PLAY; yield return null; }
public Complex c_x; // aktualis ertek #endregion Fields #region Constructors public ProcessLayer() { c_bailout = 0; c_convchktype = ConvCheck.MPL_CONVCHK_NORMAL; c_nlimit = 0; c_active = false; c_default = false; c_isin = false; c_seqtype = SeqType.MPL_SEQ_NORMAL; c_x = 0; c_checktype = SeqCheck.MPL_CHECK_NORMAL; c_checkseqtype = SeqType.MPL_SEQ_NORMAL; c_n = 0; c_calc = 0; c_resx = 0; c_orbittraptype = OrbitTrap.MPL_ORBIT_TRAP_POINT; c_pointA = 0; c_pointB = 0; }