• 大小: 0.08M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-23
  • 语言: C#
  • 标签: 拓扑  空间  查询  

资源简介

KrigingCal,线性四叉树,KrigCal

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;

namespace krig
{
    class Point3D
    {
        public double x y z;
        public Point3D(double x0 double y0 double z0)
        {
            x = x0;
            y = y0;
            z = z0;
        }

        public Point3D()
        {
            x = 0;
            y = 0;
            z = 0;
        }
    };

    class calModel
    {
        //-计算平面距离
        public static double getDist(Point3D pt1Point3D pt2)
        {
            return(Math.Sqrt((pt1.x-pt2.x)*(pt1.x-pt2.x)+(pt1.y-pt2.y)*(pt1.y-pt2.y)));
        }

        //-变异函数----
        public static double varFunction(double h)
        {
            double a=2.048b=1.154h0=8.535c0=3.202;
            double cr;
            if(h<=0)           r=0;
            else if(h<=h0)     r=a+b*(3/2*h/h0-1/2*h*h*h/h0/h0/h0);
            else               r=c0;

            c = c0 - r;
            return (c);
        }

        //--求K矩阵
        public static void calMatrixK(int ptNum List l ref double[] metrK)
        {
            int i j;
            double dist c;
            for (i = 0; i < ptNum; i++)
            {
                for (j = 0; j < ptNum; j++)
                {
                    dist = getDist(l[i] l[j]);
                    c = varFunction(dist);
                    metrK[i j] = metrK[j i] = c;
                }
            }
        }
        
        //求D矩阵
        public static void calMatrixD(int ptNum List l Point3D pt0 ref double[] metrD)
        {
            int i;
            double dist c;
            for (i = 0; i < ptNum; i++)
            {
                dist = getDist(l[i] pt0);
                c = varFunction(dist);
                metrD[i] = c;
            }
        }


        //求任意点估值
        public static double calPt(Point3D pt0 int ptNum List l double[] metrK double[] metrDref double[] vv)
        {
            int i j;
            double[] vK = new double[ptNum ptNum];

            vK = Matrix.INV(metrK);
            //double[] vv = new double[ptNum];

            
            for (i = 0; i < ptNum; i++)
            {
                vv[i]=0;
                for (j = 0; j < ptNum; j++)
                {
                    vv[i] =vv[i]+ vK[i j] * metrD[i];
                }
            }

            double z0=0sumVV=0;
            for (i = 0; i < ptNum; i++)
            {
                sumVV = sumVV + vv[i];
                z0= z0+ l[i].z*vv[i];
            }
            //把权系数进行归一处理
            z0 = z0 / sumVV; 



            return(z0);
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-10-05 08:03  KrigingCal\
     文件         925  2013-10-04 21:32  KrigingCal\krig.sln
     文件       25088  2013-10-05 08:03  KrigingCal\krig.suo
     目录           0  2013-10-04 20:57  KrigingCal\_UpgradeReport_Files\
     文件        3348  2013-10-01 21:45  KrigingCal\_UpgradeReport_Files\UpgradeReport.css
     文件       12505  2010-05-04 01:19  KrigingCal\_UpgradeReport_Files\UpgradeReport.xslt
     文件          69  2013-10-01 21:45  KrigingCal\_UpgradeReport_Files\UpgradeReport_Minus.gif
     文件          71  2013-10-01 21:45  KrigingCal\_UpgradeReport_Files\UpgradeReport_Plus.gif
     目录           0  2013-10-04 22:58  KrigingCal\线性四叉树\
     目录           0  2013-10-04 20:57  KrigingCal\线性四叉树\bin\
     目录           0  2013-10-04 20:57  KrigingCal\线性四叉树\bin\Debug\
     文件       15872  2013-10-05 08:02  KrigingCal\线性四叉树\bin\Debug\线性四叉树.exe
     文件       54784  2013-10-05 08:02  KrigingCal\线性四叉树\bin\Debug\线性四叉树.pdb
     文件       11608  2013-10-05 08:02  KrigingCal\线性四叉树\bin\Debug\线性四叉树.vshost.exe
     文件         490  2010-03-17 22:39  KrigingCal\线性四叉树\bin\Debug\线性四叉树.vshost.exe.manifest
     目录           0  2013-10-01 21:45  KrigingCal\线性四叉树\bin\Release\
     文件        2807  2013-10-05 07:54  KrigingCal\线性四叉树\calModel.cs
     文件        5874  2013-10-05 08:02  KrigingCal\线性四叉树\Form1.cs
     文件        8316  2013-10-05 00:40  KrigingCal\线性四叉树\Form1.Designer.cs
     文件        6009  2013-10-05 00:40  KrigingCal\线性四叉树\Form1.resx
     文件        5118  2013-10-04 23:25  KrigingCal\线性四叉树\krigingCal.csproj
     文件         452  2013-10-01 22:44  KrigingCal\线性四叉树\krigingCal.csproj.user
     文件        2524  2013-10-05 07:20  KrigingCal\线性四叉树\Matrix.cs
     目录           0  2013-10-04 20:57  KrigingCal\线性四叉树\obj\
     目录           0  2013-10-05 08:02  KrigingCal\线性四叉树\obj\Debug\
     文件        5453  2013-10-05 08:02  KrigingCal\线性四叉树\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         866  2013-10-05 00:40  KrigingCal\线性四叉树\obj\Debug\GenerateResource-ResGen.read.1.tlog
     文件        1414  2013-10-05 00:40  KrigingCal\线性四叉树\obj\Debug\GenerateResource-ResGen.write.1.tlog
     文件         180  2013-10-05 00:40  KrigingCal\线性四叉树\obj\Debug\krig.Form1.resources
     文件         180  2013-10-04 23:25  KrigingCal\线性四叉树\obj\Debug\krig.Properties.Resources.resources
     文件        1159  2013-10-05 08:02  KrigingCal\线性四叉树\obj\Debug\krigingCal.csproj.FileListAbsolute.txt
............此处省略18个文件信息

评论

共有 条评论