• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MatrixType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MatrixType的典型用法代码示例。如果您正苦于以下问题:C# MatrixType类的具体用法?C# MatrixType怎么用?C# MatrixType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MatrixType类属于命名空间,在下文中一共展示了MatrixType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: KmeansInput

 public KmeansInput(Array samples, MatrixType samplesType, int nClusters, CvTermCriteria criteria)
 {
     Samples = samples;
     SamplesType = samplesType;
     NClusters = nClusters;
     Criteria = criteria;
 }
开发者ID:healtech,项目名称:opencvsharp,代码行数:7,代码来源:KmeansInputOutput.cs


示例2: Visit

        protected Expression Visit(BinaryExpression expression)
        {
            // First, dispatch to resolve type of node at deeper level
            Visit((Node)expression);

            var leftType = expression.Left.TypeInference.TargetType;
            var rightType = expression.Right.TypeInference.TargetType;
            var returnType = expression.TypeInference.ExpectedType ?? expression.TypeInference.TargetType;

            bool isNumericOperator = true;

            switch (expression.Operator)
            {
                case BinaryOperator.LogicalAnd:
                case BinaryOperator.LogicalOr:
                    isNumericOperator = false;
                    returnType = GetBinaryImplicitConversionType(expression.Span, leftType, rightType, true);
                    expression.TypeInference.TargetType = returnType;
                    break;
                case BinaryOperator.Less:
                case BinaryOperator.LessEqual:
                case BinaryOperator.Greater:
                case BinaryOperator.GreaterEqual:
                case BinaryOperator.Equality:
                case BinaryOperator.Inequality:
                    isNumericOperator = false;
                    returnType = GetBinaryImplicitConversionType(expression.Span, leftType, rightType, false);

                    TypeBase resultType = ScalarType.Bool;
                    if (returnType is VectorType)
                    {
                        resultType = new VectorType(ScalarType.Bool, ((VectorType)returnType).Dimension);
                    }
                    else if (returnType is MatrixType)
                    {
                        var matrixType = (MatrixType)returnType;
                        resultType = new MatrixType(ScalarType.Bool, matrixType.RowCount, matrixType.ColumnCount);
                    }
                    expression.TypeInference.TargetType = resultType;
                    break;
            }

            if (returnType != null)
            {
                if (returnType == ScalarType.Bool && isNumericOperator)
                {
                    var typeToCheck = leftType ?? rightType;
                    if (typeToCheck != null)
                        return ConvertExpressionToBool(expression, typeToCheck);
                } 
            }

            if (!isNumericOperator || CastHelper.NeedConvertForBinary(leftType, returnType))
                expression.Left = Cast(leftType, returnType, expression.Left);
            if (!isNumericOperator || CastHelper.NeedConvertForBinary(rightType, returnType))
                expression.Right = Cast(rightType, returnType, expression.Right);

            return expression;
        }
开发者ID:cg123,项目名称:xenko,代码行数:59,代码来源:CastAnalysis.cs


示例3: Matrix4

 /// <summary>
 /// Construct a rotation matrix,origin at (0,0,0)
 /// </summary>
 /// <param name="xAxis">identity of x axis</param>
 /// <param name="yAxis">identity of y axis</param>
 /// <param name="zAxis">identity of z axis</param>
 public Matrix4(Vector4 xAxis,Vector4 yAxis, Vector4 zAxis)
 {
     m_type = MatrixType.Rotation;
     Identity();
     m_matrix[0, 0] = xAxis.X; m_matrix[0, 1] = xAxis.Y; m_matrix[0, 2] = xAxis.Z;
     m_matrix[1, 0] = yAxis.X; m_matrix[1, 1] = yAxis.Y; m_matrix[1, 2] = yAxis.Z;
     m_matrix[2, 0] = zAxis.X; m_matrix[2, 1] = zAxis.Y; m_matrix[2, 2] = zAxis.Z;
 }
开发者ID:AMEE,项目名称:revit,代码行数:14,代码来源:MathTools.cs


示例4: ConvertMaps

        public static void ConvertMaps(Mat map1, Mat map2, Mat dstmap1, Mat dstmap2, MatrixType dstmap1type, bool nninterpolation = false)
        {
            if (map1 == null)
                throw new ArgumentNullException("map1");
            if (map2 == null)
                throw new ArgumentNullException("map2");
            if (dstmap1 == null)
                throw new ArgumentNullException("dstmap1");
            if (dstmap2 == null)
                throw new ArgumentNullException("dstmap2");

            CppInvoke.cv_convertMaps(map1.CvPtr, map2.CvPtr, dstmap1.CvPtr, dstmap2.CvPtr, dstmap1type, nninterpolation);
        }
开发者ID:neoxeo,项目名称:opencvsharp,代码行数:13,代码来源:CvCpp.cs


示例5: DoubleSubmatrix

        internal DoubleSubmatrix(Matrix<double> matrix, int rowOffset, int columnOffset, int rows, int columns)
        {
            if (typeof(Matrix_SDA).IsInstanceOfType(matrix)) mt = MatrixType.SDA; // дописать
            else mt = MatrixType.SDA;

            this.offsetRow = rowOffset;
            this.offsetColumn = columnOffset;

            this.rows = rows;
            this.columns = columns;

            this.parent = matrix;
        }
开发者ID:Kadavercian,项目名称:whitemath,代码行数:13,代码来源:DoubleSubmatrix.cs


示例6: PrintMatrix

        private static void PrintMatrix(int[,] matrix, MatrixType type)
        {
            Console.WriteLine(type + "\n");

            for (int row = 0; row < matrix.GetLength(0); row++)
            {
                for (int col = 0; col < matrix.GetLength(1); col++)
                {
                    Console.Write("{0, -4}", matrix[row, col]);
                }
                Console.WriteLine();
            }
            Console.WriteLine(new String('_', matrix.GetLength(0) * 5));
        }
开发者ID:RuzmanovDev,项目名称:TelerikAcademy,代码行数:14,代码来源:NumberMatrices.cs


示例7: GetMatrix

        internal AnimatableMatrix GetMatrix(MatrixType whichMatrix)
        {
            switch (whichMatrix) {
                case MatrixType.World:
                    return World;

                case MatrixType.View:
                    return View;

                case MatrixType.Projection:
                    return Projection;

            }

            throw new InvalidOperationException(String.Format("Unrecognized matrix type: {0}", whichMatrix));
        }
开发者ID:kryptx,项目名称:Matrixplorer,代码行数:16,代码来源:ModelDisplayControl.cs


示例8: GetMatrixValuesFromXml

        /// <summary>
        /// Extracts all of the 6 values from a Transformation Matrix
        /// </summary>
        /// <param name="path">The XML containing the Transformation Matrix</param>
        /// <param name="matrixType">The type of attribute to be extracted</param>
        /// <returns></returns>
        public static string[] GetMatrixValuesFromXml(XElement path, MatrixType matrixType)
        {
            string attribute;

            if (matrixType == MatrixType.PathMatrix)
            {
                attribute = "transform";
            }
            else
            {
                attribute = "gradientTransform";
            }

            string input = path.Attribute(attribute).Value;
            return input.Split('(', ')')[1].Split(' ');
        }
开发者ID:WillCrabb,项目名称:Dissertation,代码行数:22,代码来源:Helper.cs


示例9: Matrix

        /// <summary>
        /// Constructs a matrix with a special structure, like an "Eye" Matrix (see Matlab)
        /// </summary>
        /// <param name="_n">Number of rows</param>
        /// <param name="_m">Number of columns</param>
        /// <param name="structure">Structure Type </param>
        public Matrix(int _n, int _m, MatrixType type)
        {
            noRows = _n;
            noColumns = _m;
            values = new double[noRows, noColumns];

            switch (type)
            {
                case MatrixType.EYE:
                    for (int i = 0; i < noRows; i++)
                        for (int j = 0; j < noColumns; j++)
                            if (i == j)
                                this[i, j] = 1;
                    break;
                case MatrixType.ONES:
                    for (int i = 0; i < noRows; i++)
                        for (int j = 0; j < noColumns; j++)
                            this[i, j] = 1;
                    break;
            }
        }
开发者ID:it-demircan,项目名称:NSharp,代码行数:27,代码来源:Matrix.cs


示例10: GetMatrix

        public int[,] GetMatrix(MatrixType type)
        {
            switch (type)
            {
                case MatrixType.Type_A:
                    GetMatrixTypeA();
                    break;
                case MatrixType.Type_B:
                    GetMatrixTypeB();
                    break;
                case MatrixType.Type_C:
                    GetMatrixTypeC();
                    break;
                case MatrixType.Type_D:
                    GetMatrixTypeD();
                    break;
                default:
                    break;
            }

            return this.matrix;
        }
开发者ID:RuzmanovDev,项目名称:TelerikAcademy,代码行数:22,代码来源:NumberMatrixGenerator.cs


示例11: CreateMemoryLSH

        /// <summary>
        /// Construct in-memory LSH table, with n bins.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="n"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <returns></returns>
#else
        /// <summary>
        /// Construct in-memory LSH table, with n bins.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="n"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <returns></returns>
#endif
        public static CvLSH CreateMemoryLSH(int d, int n, int L, int k, MatrixType type)
        {
            return Cv.CreateMemoryLSH(d, n, L, k, type, 4, -1);
        }
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:24,代码来源:CvLSH.cs


示例12: CvLSH

        /// <summary>
        /// Construct in-memory LSH table, with n bins.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="n"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <param name="r"></param>
        /// <param name="seed"></param>
#else
        /// <summary>
        /// Construct in-memory LSH table, with n bins.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="n"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <param name="r"></param>
        /// <param name="seed"></param>
#endif
        public CvLSH(int d, int n, int L, int k, MatrixType type, double r, Int64 seed)
        {
            _ptr = CvInvoke.cvCreateMemoryLSH(d, n, L, k, type, r, seed);
            if (_ptr == IntPtr.Zero)
            {
                throw new OpenCvSharpException("Failed to create CvLSH");
            }
        }
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:30,代码来源:CvLSH.cs


示例13: CreateLSH

        /// <summary>
        /// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
        /// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
        /// </summary>
        /// <param name="ops">(not supported argument on OpenCvSharp)</param>
        /// <param name="d"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <param name="r"></param>
        /// <param name="seed"></param>
        /// <returns></returns>
#else
        /// <summary>
        /// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
        /// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
        /// </summary>
        /// <param name="ops">(not supported argument on OpenCvSharp)</param>
        /// <param name="d"></param>
        /// <param name="L"></param>
        /// <param name="k"></param>
        /// <param name="type"></param>
        /// <param name="r"></param>
        /// <param name="seed"></param>
        /// <returns></returns>
#endif
        public static CvLSH CreateLSH(IntPtr ops, int d, int L, int k, MatrixType type, double r, Int64 seed)
        {
            return Cv.CreateLSH(ops, d, L, k, type, r, seed);
        }
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:30,代码来源:CvLSH.cs


示例14: cvInitMatNDHeader

 public static extern IntPtr cvInitMatNDHeader(IntPtr mat, int dims, int[] sizes, MatrixType type, IntPtr data);
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:1,代码来源:CvInvoke.cs


示例15: cvCreateMemoryLSH

 public static extern IntPtr cvCreateMemoryLSH(int d, int n, int L, int k, MatrixType type, double r, Int64 seed);
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:1,代码来源:CvInvoke.cs


示例16: cvCreateLSH

 public static extern IntPtr cvCreateLSH(IntPtr ops, int d, int L, int k, MatrixType type, double r, Int64 seed);
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:1,代码来源:CvInvoke.cs


示例17: Visit

 /// <summary>
 /// Visits the specified type.
 /// </summary>
 /// <param name="type">the type.</param>
 public override void Visit(MatrixType type)
 {
     Write("Matrix");
     ProcessInitialValueStatus = true;
 }
开发者ID:Kryptos-FR,项目名称:xenko-reloaded,代码行数:9,代码来源:ShaderKeyGeneratorBase.cs


示例18: HlslGrammar


//.........这里部分代码省略.........

            // Buffer Rules
            buffer_type.Rule = TypeName("Buffer") + less_than + simple_type_or_type_name + ">";

            // Vectors Rules
            vector_type.AstNodeCreator = CreateVectorAst;
            vector_type.Rule = Keyword("vector") + less_than + scalars_or_typename + "," + number + ">";
            vector_type_list.Rule = vector_type;

            // Add all vector int1 int2 int3 int4... float1 float2 float3 float4... etc.
            foreach (var scalarTypeIt in scalarTypes)
            {
                var scalarType = scalarTypeIt;
                for (var dim = 1; dim <= 4; dim++)
                {
                    var vectorTypeInstance = new VectorType(scalarTypeIt, dim);
                    var nonGenericType = vectorTypeInstance.ToNonGenericType();
                    var name = nonGenericType.Name.Text;
                    vector_type_list.Rule |= new NonTerminal(name,
                        (ctx, node) =>
                        {
                                var typeName = vectorTypeInstance.ToNonGenericType(SpanConverter.Convert(node.Span));
                                node.AstNode = typeName;
                            }) { Rule = Keyword(name) };
                }
            }

            // Matrices
            matrix_type_simple.Rule = Keyword("matrix");
            matrix_type_simple.AstNodeCreator = (ctx, node) =>
                {
                    var typeName = Ast<TypeName>(node);
                    typeName.Name = new Identifier("matrix") { Span = SpanConverter.Convert(node.Span) };
                    typeName.TypeInference.TargetType = new MatrixType(ScalarType.Float, 4, 4);
                };

            matrix_type.Rule = Keyword("matrix") + less_than + scalars_or_typename + "," + number + "," + number + ">";
            matrix_type.AstNodeCreator = CreateMatrixAst;
            matrix_type_list.Rule = matrix_type | matrix_type_simple;

            // Add all matrix typedefs: int1x1 int1x2... float1x1 float1x2 float1x3 float1x4... etc.
            foreach (var scalarTypeIt in scalarTypes)
            {
                var scalarType = scalarTypeIt;
                for (var dimX = 1; dimX <= 4; dimX++)
                    for (var dimY = 1; dimY <= 4; dimY++)
                    {
                        var matrixTypeInstance = new MatrixType(scalarTypeIt, dimY, dimX);
                        var nonGenericType = matrixTypeInstance.ToNonGenericType();
                        var name = nonGenericType.Name.Text;

                        // var typeName = new TypeName(name) { Alias = matrixTypeInstance };
                        matrix_type_list.Rule |= new NonTerminal(
                            name,
                            (ctx, node) =>
                                {
                                    var typeName = matrixTypeInstance.ToNonGenericType(SpanConverter.Convert(node.Span));
                                    node.AstNode = typeName;
                                }) { Rule = Keyword(name) };
                    }
            }

            // Sampler types
            state_type.Rule = CreateRuleFromObjectTypes(
                StateType.BlendState,
                StateType.DepthStencilState,
开发者ID:Powerino73,项目名称:paradox,代码行数:67,代码来源:HlslGrammar.cs


示例19: cvCreateSparseMat

 public static extern IntPtr cvCreateSparseMat(int dims, [In] int[] sizes, MatrixType type);
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:1,代码来源:CvInvoke.cs


示例20: cvInitMatHeader

 public static extern IntPtr cvInitMatHeader(IntPtr mat, int rows, int cols, MatrixType type, IntPtr data, int step);
开发者ID:sanglin307,项目名称:UnityOpenCV,代码行数:1,代码来源:CvInvoke.cs



注:本文中的MatrixType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Maybe类代码示例发布时间:2022-05-24
下一篇:
C# MatrixOrder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap