2010年9月28日星期二

Gaussian Elimination without pivoting

Given a matrix A (nXn), define the a series matrices as following:

A_1 = | a_{1,1} |
        
         | a_{1,1} a_{1,2} |
A_2 = | a_{2,1} a_{2,2} | 

         | a_{1,1} a_{1,2} a_{1,3} |
A_3 = | a_{2,1} a_{2,2} a_{2,3} |
         | a_{3,1} a_{3,2} a_{3,3} |

…

Now, it could be verified that we can using Gaussian Elimination for matrix A without pivoting if and only if A_1, A_2, \cdots, A_n are all non-singular.

2010年9月27日星期一

I don’t really understand Gaussian Elimination!

That’s right! You think you know it, but unfortunately that might be not true!

The baby-level thing – Gaussian Elimination is quite straightforward.  But the following things might be not that familiar to you. First of all, GE could give us the LU decomposition for most matrices. Second, GE is connected to the so-called completing squares in some interesting ways.

Anyway, I have to stop this post.

2010年2月2日星期二

悲剧

终于体会到,为啥对于某些类,要设计诸如GetValue和SetValue的接口函数了,而不是直接采用赋值。悲剧。。。

2009年12月17日星期四

算法考试结束

不知道以后会不会忘了

活着

这部电影,我看了

2009年12月8日星期二

关于这么一个指针传参数的问题

今天在写一个函数,就是要重新给一个指针分配一块内存。比如
void renew(int * array, int b)
{
     delete [] array;
     int size = 2*b;
     array = new int[size];
     memset(array,13,sizeof(int)*size);
}
void main()
{
     int * array;
     int size = 13;
     array = new int [size];
     memset(array,0,sizeof(int)*size);
     renew(array);
     delete [] array;
}
结果胡折腾了一会,企图修改数组的内容,实际上毛用都没。后来哥悟到了,具体参考这里。
不过哥哥有个比那文章稍好点的解决方法,那文章说真要用,就用int **。其实当然也可用一个指针的拷贝,这样具体代码都不用改,那么,请听题,如果修改renew函数的参数?
A) void renew( &(int * array), int b)
B) void renew( int &(*array), int b)
C) void renew( int &* array, int b)
D) void renew( int *& array, int b)

void renew(int *&array, int b)


2009年12月5日星期六

关于向量夹角的问题

昨天一个问题貌似没想通,太囧了,看起来貌似很简单。
就是三维空间中,给了两个向量,就它们之间的夹角。当然有内积是,然后acos是可以算出来的。不过这个角度是无视转向。两个步骤可以结局,首先是要找一个法向量;其次是假定在一个平面中,求个带正负的面积。