static VectorsClasses getVectorClassesFor( final TVector v) { NullCheck.notNull(v, "v"); final TypeScalarType e_type = v.getElementType(); final int e_count = v.getElementCount().getValue().intValue(); return e_type.matchTypeScalar(new VectorClassMatcher(e_count)); }
meta_field_name, JPRATypeModel.JPRAVector.class, t.getElementCount().getValue()); this.constructor_builder.endControlFlow();
@Test public final void testTypeExprVector_1() throws Exception { final JPRAParserType p = this.newParser(); final GlobalContextType c = GlobalContexts.newContext(new AlwaysEmptyLoader()); final JPRAResolverType r = this.newResolver(c); final JPRACheckerType ch = this.newChecker( c, JPRACheckerStandardCapabilities.newCapabilities()); final TypeExprType<IdentifierType, Untyped> te = r.resolveTypeExpression( p.parseTypeExpression( this.newStringSExpr("(vector [float 32] 4)"))); final TypeExprVector<IdentifierType, TType> e = TypeExprVector.class.cast(ch.checkTypeExpression(te)); final TVector t = TVector.class.cast(e.getType()); Assert.assertEquals(BigInteger.valueOf(4L), t.getElementCount().getValue()); Assert.assertEquals(TFloat.class, t.getElementType().getClass()); }
@Test public final void testTypeExprVector_0() throws Exception { final JPRAParserType p = this.newParser(); final GlobalContextType c = GlobalContexts.newContext(new AlwaysEmptyLoader()); final JPRAResolverType r = this.newResolver(c); final JPRACheckerType ch = this.newChecker( c, JPRACheckerStandardCapabilities.newCapabilities()); final TypeExprType<IdentifierType, Untyped> te = r.resolveTypeExpression( p.parseTypeExpression( this.newStringSExpr("(vector [integer signed 32] 4)"))); final TypeExprVector<IdentifierType, TType> e = TypeExprVector.class.cast(ch.checkTypeExpression(te)); final TVector t = TVector.class.cast(e.getType()); Assert.assertEquals(BigInteger.valueOf(4L), t.getElementCount().getValue()); Assert.assertEquals(TIntegerSigned.class, t.getElementType().getClass()); }