#include <linalg.hpp>


Public Member Functions | |
| ~vector_view () | |
| vector_view & | operator= (const vector &w) |
| vector_view & | operator= (const vector_view &w) |
| Assignment, useful for modifying chunks of vectors all at once. | |
Private Member Functions | |
| vector_view () | |
| vector_view (gsl_vector *y, const slice &s) | |
| See above. | |
| vector_view (gsl_matrix *A, const slice &a, const size_t j) | |
| See above. | |
| vector_view (gsl_matrix *A, const size_t i, const slice &b) | |
| See above. | |
Friends | |
| class | vector |
| class | matrix |
| linalg::vector_view::vector_view | ( | ) | [private] |
| linalg::vector_view::vector_view | ( | gsl_vector * | y, | |
| const slice & | s | |||
| ) | [private] |
See above.
00632 :vector(new gsl_vector){ 00633 if(s.end() > y->size - 1){ 00634 indexOutOfRange exc; 00635 exc.file = __FILE__; 00636 exc.line = __LINE__; 00637 exc.reason = "invalid vector slice upper range."; 00638 exc.i = s.end(); 00639 exc.n = y->size; 00640 throw exc; 00641 } 00642 x -> size = (s.end() - s.begin())/s.stride()+1; 00643 x -> data = gsl_vector_ptr(y,s.begin()); 00644 x -> stride = s.stride(); 00645 x -> block = 0; 00646 x -> owner = 0; 00647 }

| linalg::vector_view::vector_view | ( | gsl_matrix * | A, | |
| const slice & | a, | |||
| const size_t | j | |||
| ) | [private] |
See above.
00649 :vector(new gsl_vector){ 00650 if(a.end() > A -> size1 - 1 or j-1 > A -> size2-1){ 00651 indexOutOfRange exc; 00652 exc.file = __FILE__; 00653 exc.line = __LINE__; 00654 exc.reason = "invalid matrix view range."; 00655 exc.i = a.end(); 00656 exc.j = j; 00657 exc.n = A -> size1; 00658 exc.m = A -> size2; 00659 throw exc; 00660 } 00661 x -> size = (a.end() - a.begin())/a.stride()+1; 00662 x -> data = gsl_matrix_ptr(A, a.begin(), j-1); 00663 x -> stride = a.stride()*(A -> tda); //Note that a longer step is 00664 //necessary here. 00665 x -> block = 0; 00666 x -> owner = 0; 00667 }

| linalg::vector_view::vector_view | ( | gsl_matrix * | A, | |
| const size_t | i, | |||
| const slice & | b | |||
| ) | [private] |
See above.
00669 :vector(new gsl_vector){ 00670 if(b.end() > A -> size2 - 1 or i-1 > A-> size1-1){ 00671 indexOutOfRange exc; 00672 exc.file = __FILE__; 00673 exc.line = __LINE__; 00674 exc.reason = "invalid matrix view range."; 00675 exc.i = i; 00676 exc.j = b.end(); 00677 exc.n = A -> size1; 00678 exc.m = A -> size2; 00679 throw exc; 00680 } 00681 x -> size = (b.end() - b.begin())/b.stride()+1; 00682 x -> data = gsl_matrix_ptr(A, i-1, b.begin()); 00683 x -> stride = b.stride(); 00684 x -> block = 0; 00685 x -> owner = 0; 00686 }

| vector_view & linalg::vector_view::operator= | ( | const vector & | w | ) |
Assignment to a vector; will share same data in memory as that other vector.
Reimplemented from linalg::vector.
00688 { 00689 if(x->size != w.size()){ 00690 badArgument exc; 00691 exc.reason = "Cannot assign to vector view: incomformant sizes."; 00692 exc.file = __FILE__; 00693 exc.line = __LINE__; 00694 throw exc; 00695 } 00696 gsl_vector_memcpy(x,w.x); 00697 return *this; 00698 }

| vector_view & linalg::vector_view::operator= | ( | const vector_view & | w | ) |
Assignment, useful for modifying chunks of vectors all at once.
00700 { 00701 if(x->size != w.size()){ 00702 badArgument exc; 00703 exc.reason = "Cannot assign to vector view: incomformant sizes."; 00704 exc.file = __FILE__; 00705 exc.line = __LINE__; 00706 throw exc; 00707 } 00708 gsl_vector_memcpy(x,w.x); 00709 return *this; 00710 00711 }

friend class vector [friend] |
friend class matrix [friend] |
Reimplemented from linalg::vector.
1.5.6