###### R4 欧氏空间Schmidt正交化方法
#include<iostream>
using namespace std;

class Euclidean{
public:
Euclidean(double x1 = 0, double x2 = 0, double x3 = 0, double x4 = 0) :
x1(x1), x2(x2), x3(x3), x4(x4){}
friend Euclidean operator-(Euclidean &a1, Euclidean &a2);
friend Euclidean operator*(double a, Euclidean &a1);
friend ostream & operator<<(ostream &out, const Euclidean &a);
friend double Cal(Euclidean &a1, Euclidean &a2);
void Assignment(double a1, double a2, double a3, double a4)
{
this->x1 = a1;
this->x2 = a2;
this->x3 = a3;
this->x4 = a4;
}
private:
double x1,x2,x3,x4;
};

Euclidean operator-(Euclidean &a1, Euclidean &a2)
{
return Euclidean(a1.x1 - a2.x1, a1.x2 - a2.x2, a1.x3 - a2.x3, a1.x4 - a2.x4);
}

Euclidean operator*(double a, Euclidean &a1)
{
return Euclidean (a*a1.x1, a*a1.x2, a*a1.x3, a*a1.x4);
}

ostream & operator<<(ostream &out, const Euclidean &a)
{
out << "(" << a.x1 << "," << a.x2 << "," << a.x3 << "," << a.x4 << ")";
return out;
}

double Cal(Euclidean &a1, Euclidean &a2)
{
return ((a1.x1*a2.x1 + a1.x2*a2.x2 + a1.x3*a2.x3 + a1.x4*a2.x4) /
(a2.x1*a2.x1 + a2.x2*a2.x2 + a2.x3*a2.x3 + a2.x4*a2.x4));
}

int main()
{
cout << "Please enter the number of vectors(n<=4): ";
int n;
cin >> n;

Euclidean*a = new Euclidean[n];
double aa[4];

for (int i = 0; i < n; i++)
{
for (int j = 0; j < 4; j++)
cin >> aa[j];
a[i].Assignment(aa[0], aa[1], aa[2], aa[3]);
}

Euclidean*p = new Euclidean[n];

for (int i = 0; i < n; i++)
{
p[i] = a[i];
for (int j = 0; j < i; j++)
p[i] = p[i]-Cal(a[i], p[j])*p[j];
}

for (int i = 0; i < n; i++)
cout << p[i] << endl;

delete[]a;
delete[]p;

return 0;
}

#### schmidt正交化matlab程序

2015年10月20日 445B 下载

#### 【线性代数】标准正交矩阵与Gram-Schmidt正交化

2014-12-06 15:04:01

#### 线性代数导论17——正交矩阵和Gram-Schmidt正交化

2013-10-31 11:52:05

#### 施密特正交化（Gram–Schmidt process）

2009-11-18 15:06:00

#### 正交矩阵和Gram-Schmidt正交化

2014-07-09 16:42:38

#### 矩阵论笔记（三）——欧氏空间与正交变换

2017-03-16 11:38:24

#### gram_schmidt正交化

2018年03月30日 229B 下载

#### 格拉姆－施密特正交化Gram-Schimidt

2012-04-11 15:48:54

#### 斯密特正交化进行QR分解

2017-07-03 23:19:41

#### 通俗理解“Schmidt正交化”和“正交矩阵” 此博文包含图片 (2015-05-19 09:50:47) 施密特正交化在空间上是不断建立垂直于原次维空间的新向量的过程。 如图β2垂直于β1（1维）

2017-09-23 12:03:20

## 不良信息举报

R4 欧氏空间Schmidt正交化方法