26#ifndef _CXSC_SIMATRIX_HPP_INCLUDED
27#define _CXSC_SIMATRIX_HPP_INCLUDED
29#include <interval.hpp>
32#include <sivector.hpp>
37#include <sparseidot.hpp>
38#include <sparsematrix.hpp>
39#include <srmatrix.hpp>
52inline bool comp_pair_i(std::pair<int,interval> p1, std::pair<int,interval> p2) {
53 return p1.first < p2.first;
74 std::vector<interval> x;
107 const std::vector<interval>&
values()
const {
115 lb1 = lb2 = ub1 = ub2 = 0;
119 simatrix(
const int r,
const int c) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) {
120 p = std::vector<int>((n>0) ? n+1 : 1, 0);
121 ind.reserve(2*(m+n));
128 simatrix(
const int r,
const int c,
const int e) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) {
129 p = std::vector<int>((n>0) ? n+1 : 1, 0);
147 p = std::vector<int>(n+1,0);
153 std::vector<triplet_store<interval> > work;
156 for(
int k=0 ; k<nnz ; k++) {
157 work.push_back(triplet_store<interval>(rows[
Lb(rows)+k],cols[
Lb(cols)+k],
values[
Lb(
values)+k]));
160 sort(work.begin(), work.end());
164 for(
int j=0 ; j<n ; j++) {
166 while((
unsigned int)i < work.size() && work[i].col == j ) {
167 ind.push_back(work[i].row);
168 x.push_back(work[i].val);
175 }
else if(t == compressed_row) {
179 p = std::vector<int>(n+1,0);
185 for(
int i=0 ; i<n+1 ; i++)
186 p[i] = rows[
Lb(rows)+i];
188 std::vector<triplet_store<interval> > work;
191 for(
int j=0 ; j<n ; j++) {
192 for(
int k=p[j] ; k<p[j+1] ; k++) {
193 work.push_back(triplet_store<interval>(j,cols[
Lb(cols)+k],
values[
Lb(
values)+k]));
197 sort(work.begin(), work.end());
201 for(
int j=0 ; j<n ; j++) {
203 while((
unsigned int)i < work.size() && work[i].col == j ) {
204 ind.push_back(work[i].row);
205 x.push_back(work[i].val);
212 }
else if(t == compressed_column) {
215 p = std::vector<int>(n+1,0);
221 for(
int i=0 ; i<n+1 ; i++)
222 p[i] = rows[
Lb(rows)+i];
224 std::vector<std::pair<int,interval> > work;
227 for(
int j=0 ; j<n ; j++) {
230 for(
int k=p[j] ; k<p[j+1] ; k++) {
234 std::sort(work.begin(),work.end(),comp_pair_i);
236 for(
unsigned int i=0 ; i<work.size() ; i++) {
237 ind.push_back(work[i].first);
238 x.push_back(work[i].second);
258 p = std::vector<int>(n+1,0);
264 std::vector<triplet_store<interval> > work;
267 for(
int k=0 ; k<nnz ; k++) {
268 work.push_back(triplet_store<interval>(rows[k],cols[k],
values[k]));
271 sort(work.begin(), work.end());
275 for(
int j=0 ; j<n ; j++) {
277 while((
unsigned int)i < work.size() && work[i].col == j ) {
278 ind.push_back(work[i].row);
279 x.push_back(work[i].val);
286 }
else if(t == compressed_row) {
290 p = std::vector<int>(n+1,0);
296 for(
int i=0 ; i<n+1 ; i++)
299 std::vector<triplet_store<interval> > work;
302 for(
int j=0 ; j<n ; j++) {
303 for(
int k=p[j] ; k<p[j+1] ; k++) {
304 work.push_back(triplet_store<interval>(j,cols[k],
values[k]));
308 sort(work.begin(), work.end());
312 for(
int j=0 ; j<n ; j++) {
314 while((
unsigned int)i < work.size() && work[i].col == j ) {
315 ind.push_back(work[i].row);
316 x.push_back(work[i].val);
323 }
else if(t == compressed_column) {
326 p = std::vector<int>(n+1,0);
332 for(
int i=0 ; i<n+1 ; i++)
335 std::vector<std::pair<int,interval> > work;
338 for(
int j=0 ; j<n ; j++) {
341 for(
int k=p[j] ; k<p[j+1] ; k++) {
342 work.push_back(std::make_pair(cols[k],
values[k]));
345 std::sort(work.begin(),work.end(),comp_pair_i);
347 for(
unsigned int i=0 ; i<work.size() ; i++) {
348 ind.push_back(work[i].first);
349 x.push_back(work[i].second);
359 simatrix(
const srmatrix& A) : p(A.p), ind(A.ind), m(A.m), n(A.n), lb1(A.lb1), ub1(A.ub1), lb2(A.lb2), ub2(A.ub2) {
361 for(
unsigned int i=0 ; i<A.x.size() ; i++)
368 p = std::vector<int>((n>0) ? n+1 : 1, 0);
369 ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
370 x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
375 for(
int j=0 ; j<n ; j++) {
376 for(
int i=0 ; i<m ; i++) {
377 if(A[i+lb1][j+lb2] != 0.0) {
379 x.push_back(
interval(A[i+lb1][j+lb2]));
391 p = std::vector<int>((n>0) ? n+1 : 1, 0);
392 ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
393 x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
398 for(
int j=0 ; j<n ; j++) {
399 for(
int i=0 ; i<m ; i++) {
400 if(A[i+lb1][j+lb2] != 0.0) {
402 x.push_back(
interval(A[i+lb1][j+lb2]));
416 simatrix(
const int ms,
const int ns,
const imatrix& A) : m(ms), n(ns), lb1(1), ub1(ms), lb2(1), ub2(ns) {
419 p = std::vector<int>((n>0) ? n+1 : 1, 0);
423 std::vector<triplet_store<interval> > work;
427 for(
int i=0 ; i<
ColLen(A) ; i++) {
428 for(
int j=
Lb(A,2) ; j<=
Ub(A,2) ; j++) {
429 if(i+j >=0 && i+j < n) {
430 work.push_back(triplet_store<interval>(i,i+j,A[i+
Lb(A,1)][j]));
435 sort(work.begin(), work.end());
439 for(
int j=0 ; j<n ; j++) {
441 while((
unsigned int)i < work.size() && work[i].col == j ) {
442 ind.push_back(work[i].row);
443 x.push_back(work[i].val);
461 for(
int j=0 ; j<n ; j++) {
462 for(
int k=p[j] ; k<p[j+1] ; k++) {
463 A[ind[k]+lb1][j+lb2] = x[k];
474 std::vector<int> pnew(n+1,0);
475 std::vector<int> indnew;
476 std::vector<interval> xnew;
479 for(
int j=0 ; j<n ; j++) {
480 for(
int k=p[j] ; k<p[j+1] ; k++) {
482 xnew.push_back(x[k]);
483 indnew.push_back(ind[k]);
498 return sp_ms_assign<simatrix,real,interval>(*
this,A);
503 return sp_ms_assign<simatrix,interval,interval>(*
this,A);
508 return spf_mm_assign<simatrix,rmatrix,interval>(*
this,A);
513 return spf_mm_assign<simatrix,imatrix,interval>(*
this,A);
518 return spf_mm_assign<simatrix,rmatrix_slice,interval>(*
this,A);
523 return spf_mm_assign<simatrix,imatrix_slice,interval>(*
this,A);
534 for(
unsigned int i=0 ; i<A.x.size() ; i++)
560 if(i<lb1 || i>ub1 || j<lb2 || j>ub2)
561 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator()(int, int)"));
564 for(
int k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) {
565 if(ind[k] == i-lb1) r = x[k];
581 if(i<lb1 || i>ub1 || j<lb2 || j>ub2)
582 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator()(int, int)"));
585 for(k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) {
586 if(ind[k] == i-lb1)
return x[k];
590 std::vector<int>::iterator ind_it = ind.begin() + k;
591 std::vector<interval>::iterator x_it = x.begin() + k;
592 ind.insert(ind_it, i-lb1);
593 x_it = x.insert(x_it,
interval(0.0));
594 for(k=j-lb2+1 ; k<(int)p.size() ; k++)
620 for(
int k=0 ; k<n ; k++) {
623 std::map<int,interval> work;
624 for(
int j=p[q[
Lb(q)+k]] ; j<p[q[
Lb(q)+k]+1] ; j++)
625 work.insert(std::make_pair(per[
Lb(per)+ind[j]], x[j]));
627 for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) {
628 A.ind.push_back(it->first);
629 A.x.push_back(it->second);
646 for(
int k=0 ; k<n ; k++) {
649 std::map<int,interval> work;
650 for(
int j=p[k] ; j<p[k+1] ; j++)
651 work.insert(std::make_pair(per[
Lb(per)+ind[j]], x[j]));
653 for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) {
654 A.ind.push_back(it->first);
655 A.x.push_back(it->second);
680 return p[n]/((double)m*n);
690 return spf_mm_addassign<simatrix,rmatrix,imatrix>(*
this,B);
695 return spf_mm_addassign<simatrix,imatrix,imatrix>(*
this,B);
700 return spf_mm_addassign<simatrix,rmatrix_slice,imatrix>(*
this,B);
705 return spf_mm_addassign<simatrix,imatrix_slice,imatrix>(*
this,B);
710 return spsp_mm_addassign<simatrix,srmatrix,interval>(*
this,B);
715 return spsp_mm_addassign<simatrix,simatrix,interval>(*
this,B);
720 return spf_mm_subassign<simatrix,rmatrix,imatrix>(*
this,B);
725 return spf_mm_subassign<simatrix,imatrix,imatrix>(*
this,B);
730 return spf_mm_subassign<simatrix,rmatrix_slice,imatrix>(*
this,B);
735 return spf_mm_subassign<simatrix,imatrix_slice,imatrix>(*
this,B);
740 return spsp_mm_subassign<simatrix,srmatrix,interval>(*
this,B);
745 return spsp_mm_subassign<simatrix,simatrix,interval>(*
this,B);
750 return spf_mm_multassign<simatrix,imatrix,sparse_idot,imatrix>(*
this,B);
755 return spf_mm_multassign<simatrix,rmatrix,sparse_idot,imatrix>(*
this,B);
760 return spf_mm_multassign<simatrix,rmatrix_slice,sparse_idot,imatrix>(*
this,B);
765 return spf_mm_multassign<simatrix,imatrix_slice,sparse_idot,imatrix>(*
this,B);
770 return spsp_mm_multassign<simatrix,srmatrix,sparse_idot,interval>(*
this,B);
775 return spsp_mm_multassign<simatrix,simatrix,sparse_idot,interval>(*
this,B);
780 return sp_ms_multassign(*
this,r);
785 return sp_ms_multassign(*
this,r);
790 return sp_ms_divassign(*
this,r);
795 return sp_ms_divassign(*
this,r);
800 return spf_mm_hullassign<simatrix,rmatrix,imatrix>(*
this,B);
805 return spf_mm_hullassign<simatrix,imatrix,imatrix>(*
this,B);
810 return spf_mm_hullassign<simatrix,rmatrix_slice,imatrix>(*
this,B);
815 return spf_mm_hullassign<simatrix,imatrix_slice,imatrix>(*
this,B);
820 return spsp_mm_hullassign<simatrix,srmatrix,interval>(*
this,B);
825 return spsp_mm_hullassign<simatrix,simatrix,interval>(*
this,B);
830 return spf_mm_intersectassign<simatrix,imatrix,imatrix>(*
this,B);
835 return spf_mm_intersectassign<simatrix,imatrix_slice,imatrix>(*
this,B);
840 return spsp_mm_intersectassign<simatrix,simatrix,interval>(*
this,B);
881#include "matrix_friend_declarations.inl"
886 lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2;
890 for(
int j=0 ; j<A.n ; j++) {
891 for(
int k=A.p[j] ; k<A.p[j+1] ; k++) {
892 dat[A.ind[k]*A.n+j] = A.x[k];
899 lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2;
903 for(
int j=0 ; j<A.n ; j++) {
904 for(
int k=A.p[j] ; k<A.p[j+1] ; k++) {
905 dat[A.ind[k]*A.n+j] = A.x[k];
912 simatrix I(A.m, A.n, (A.m>A.n) ? A.m : A.n);
913 I.lb1 = A.lb1; I.lb2 = A.lb2;
914 I.ub1 = A.ub1; I.ub2 = A.ub2;
917 for(
int i=0 ; i<A.m ; i++) {
918 I.p[i+1] = I.p[i] + 1;
923 for(
int i=0 ; i<A.n ; i++) {
924 I.p[i+1] = I.p[i] + 1;
938 std::vector<int> w(A.m,0);
939 for(
unsigned int i=0 ; i<A.ind.size() ; i++)
945 for(
unsigned int i=1 ; i<B.p.size() ; i++)
946 B.p[i] = w[i-1] + B.p[i-1];
949 w.insert(w.begin(), 0);
950 for(
unsigned int i=1 ; i<w.size() ; i++) {
958 for(
int j=0 ; j<A.n ; j++) {
959 for(
int k=A.p[j] ; k<A.p[j+1] ; k++) {
1046inline void Resize(
simatrix& A,
const int l1,
const int u1,
const int l2,
const int u2) {
1047 sp_m_resize(A,l1,u1,l2,u2);
1060 for(
int i=0 ; i<res.
get_nnz() ; i++)
1061 res.x.push_back(Inf(A.x[i]));
1078 for(
int i=0 ; i<res.
get_nnz() ; i++)
1079 res.x.push_back(Sup(A.x[i]));
1096 for(
int i=0 ; i<res.
get_nnz() ; i++)
1097 res.x.push_back(
abs(A.x[i]));
1114 for(
int i=0 ; i<res.
get_nnz() ; i++)
1115 res.x.push_back(
AbsMin(A.x[i]));
1132 for(
int i=0 ; i<res.
get_nnz() ; i++)
1133 res.x.push_back(
AbsMax(A.x[i]));
1149 res.p[A.n] = A.p[A.n];
1151 for(
int j=0 ; j<res.n ; j++) {
1152 for(
int k=A.p[j] ; k<A.p[j+1] ; k++) {
1154 res.x.push_back(
AbsMin(A.x[k]));
1156 res.x.push_back(-
AbsMax(A.x[k]));
1175 for(
int i=0 ; i<res.
get_nnz() ; i++)
1176 res.x.push_back(
mid(A.x[i]));
1193 for(
int i=0 ; i<res.
get_nnz() ; i++)
1194 res.x.push_back(
diam(A.x[i]));
1210 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(A,B);
1221 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(A,B);
1232 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(A,B);
1243 return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(A,B);
1254 return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(A,B);
1265 return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(A,B);
1276 return fsp_mm_mult<imatrix_slice,srmatrix,imatrix,sparse_idot>(A,B);
1287 return fsp_mm_mult<rmatrix_slice,simatrix,imatrix,sparse_idot>(A,B);
1298 return fsp_mm_mult<imatrix_slice,simatrix,imatrix,sparse_idot>(A,B);
1309 return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(A,B);
1320 return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(A,B);
1331 return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(A,B);
1342 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(A,B);
1353 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(A,B);
1364 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(A,B);
1369 return sp_ms_div<simatrix,real,simatrix>(A,r);
1374 return sp_ms_div<simatrix,interval,simatrix>(A,r);
1379 return sp_ms_div<srmatrix,interval,simatrix>(A,r);
1384 return sp_ms_mult<simatrix,real,simatrix>(A,r);
1389 return sp_ms_mult<simatrix,interval,simatrix>(A,r);
1394 return sp_ms_mult<srmatrix,interval,simatrix>(A,r);
1399 return sp_sm_mult<real,simatrix,simatrix>(r,A);
1404 return sp_sm_mult<interval,simatrix,simatrix>(r,A);
1409 return sp_sm_mult<interval,srmatrix,simatrix>(r,A);
1420 return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(A,v);
1431 return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(A,v);
1442 return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(A,v);
1453 return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(A,v);
1464 return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(A,v);
1475 return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(A,v);
1486 return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(A,v);
1497 return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(A,v);
1508 return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(A,v);
1519 return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(A,v);
1530 return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(A,v);
1541 return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(A,v);
1552 return fsp_mv_mult<imatrix,srvector,ivector,sparse_idot>(A,v);
1563 return fsp_mv_mult<rmatrix,sivector,ivector,sparse_idot>(A,v);
1574 return fsp_mv_mult<imatrix,sivector,ivector,sparse_idot>(A,v);
1585 return fsp_mv_mult<imatrix_slice,srvector,ivector,sparse_idot>(A,v);
1596 return fsp_mv_mult<rmatrix_slice,sivector,ivector,sparse_idot>(A,v);
1607 return fsp_mv_mult<imatrix_slice,sivector,ivector,sparse_idot>(A,v);
1618 return fsl_mv_mult<imatrix,srvector_slice,ivector,sparse_idot>(A,v);
1629 return fsl_mv_mult<rmatrix,sivector_slice,ivector,sparse_idot>(A,v);
1640 return fsl_mv_mult<imatrix,sivector_slice,ivector,sparse_idot>(A,v);
1651 return fsl_mv_mult<imatrix_slice,srvector_slice,ivector,sparse_idot>(A,v);
1662 return fsl_mv_mult<rmatrix_slice,sivector_slice,ivector,sparse_idot>(A,v);
1673 return fsl_mv_mult<imatrix_slice,sivector_slice,ivector,sparse_idot>(A,v);
1678 return fsp_mm_add<imatrix,srmatrix,imatrix>(A,B);
1683 return fsp_mm_add<rmatrix,simatrix,imatrix>(A,B);
1688 return fsp_mm_add<imatrix,simatrix,imatrix>(A,B);
1693 return spf_mm_add<simatrix,rmatrix,imatrix>(A,B);
1698 return spf_mm_add<srmatrix,imatrix,imatrix>(A,B);
1703 return spf_mm_add<simatrix,imatrix,imatrix>(A,B);
1708 return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(A,B);
1713 return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(A,B);
1718 return fsp_mm_add<imatrix_slice,simatrix,imatrix>(A,B);
1723 return spf_mm_add<simatrix,rmatrix_slice,imatrix>(A,B);
1728 return spf_mm_add<srmatrix,imatrix_slice,imatrix>(A,B);
1733 return spf_mm_add<simatrix,imatrix_slice,imatrix>(A,B);
1738 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(A,B);
1743 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(A,B);
1748 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(A,B);
1753 return fsp_mm_sub<imatrix,srmatrix,imatrix>(A,B);
1758 return fsp_mm_sub<rmatrix,simatrix,imatrix>(A,B);
1763 return fsp_mm_sub<imatrix,simatrix,imatrix>(A,B);
1768 return spf_mm_sub<simatrix,rmatrix,imatrix>(A,B);
1773 return spf_mm_sub<srmatrix,imatrix,imatrix>(A,B);
1778 return spf_mm_sub<simatrix,imatrix,imatrix>(A,B);
1783 return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(A,B);
1788 return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(A,B);
1793 return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(A,B);
1798 return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(A,B);
1803 return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(A,B);
1808 return spf_mm_sub<simatrix,imatrix_slice,imatrix>(A,B);
1813 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(A,B);
1818 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(A,B);
1823 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(A,B);
1828 return fsp_mm_hull<imatrix,srmatrix,imatrix>(A,B);
1833 return fsp_mm_hull<rmatrix,simatrix,imatrix>(A,B);
1838 return fsp_mm_hull<imatrix,simatrix,imatrix>(A,B);
1843 return spf_mm_hull<simatrix,rmatrix,imatrix>(A,B);
1848 return spf_mm_hull<srmatrix,imatrix,imatrix>(A,B);
1853 return spf_mm_hull<simatrix,imatrix,imatrix>(A,B);
1858 return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(A,B);
1863 return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(A,B);
1868 return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(A,B);
1873 return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(A,B);
1878 return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(A,B);
1883 return spf_mm_hull<simatrix,imatrix_slice,imatrix>(A,B);
1888 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(A,B);
1893 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(A,B);
1898 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(A,B);
1903 return fsp_mm_hull<rmatrix,srmatrix,imatrix>(A,B);
1908 return spf_mm_hull<srmatrix,rmatrix,imatrix>(A,B);
1913 return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(A,B);
1918 return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(A,B);
1923 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(A,B);
1928 return fsp_mm_intersect<imatrix,simatrix,imatrix>(A,B);
1933 return spf_mm_intersect<simatrix,imatrix,imatrix>(A,B);
1938 return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(A,B);
1943 return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(A,B);
1948 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(A,B);
1953 return sp_m_negative<simatrix,simatrix>(M);
1972 return fsp_mm_addassign(*
this,B);
1976 return fsp_mm_addassign(*
this,B);
1980 return fsp_mm_addassign(*
this,B);
1984 return fsp_mm_addassign(*
this,B);
1988 return fsp_mm_subassign(*
this,B);
1992 return fsp_mm_subassign(*
this,B);
1996 return fsp_mm_subassign(*
this,B);
2000 return fsp_mm_subassign(*
this,B);
2004 return fsp_mm_multassign<imatrix,srmatrix,sparse_idot,imatrix>(*
this,B);
2008 return fsp_mm_multassign<imatrix,simatrix,sparse_idot,imatrix>(*
this,B);
2012 return fsp_mm_multassign<imatrix_slice,srmatrix,sparse_idot,imatrix>(*
this,B);
2016 return fsp_mm_multassign<imatrix_slice,simatrix,sparse_idot,imatrix>(*
this,B);
2020 return fsp_mm_hullassign(*
this,B);
2024 return fsp_mm_hullassign(*
this,B);
2028 return fsp_mm_hullassign(*
this,B);
2032 return fsp_mm_hullassign(*
this,B);
2036 return fsp_mm_intersectassign(*
this,B);
2040 return fsp_mm_intersectassign(*
this,B);
2044 return fsp_mm_intersectassign(*
this,B);
2048 return fsp_mm_intersectassign(*
this,B);
2053 return spsp_mm_comp(A,B);
2058 return spsp_mm_comp(A,B);
2063 return spsp_mm_comp(A,B);
2068 return spf_mm_comp(A,B);
2073 return spf_mm_comp(A,B);
2078 return spf_mm_comp(A,B);
2083 return fsp_mm_comp(A,B);
2088 return fsp_mm_comp(A,B);
2093 return fsp_mm_comp(A,B);
2098 return fsp_mm_comp(A,B);
2103 return fsp_mm_comp(A,B);
2108 return fsp_mm_comp(A,B);
2113 return spf_mm_comp(A,B);
2118 return spf_mm_comp(A,B);
2123 return spf_mm_comp(A,B);
2128 return !spsp_mm_comp(A,B);
2133 return !spsp_mm_comp(A,B);
2138 return !spsp_mm_comp(A,B);
2143 return !spf_mm_comp(A,B);
2148 return !spf_mm_comp(A,B);
2153 return !spf_mm_comp(A,B);
2158 return !fsp_mm_comp(A,B);
2163 return !fsp_mm_comp(A,B);
2168 return !fsp_mm_comp(A,B);
2173 return !fsp_mm_comp(A,B);
2178 return !fsp_mm_comp(A,B);
2183 return !fsp_mm_comp(A,B);
2188 return !spf_mm_comp(A,B);
2193 return !spf_mm_comp(A,B);
2198 return !spf_mm_comp(A,B);
2203 return spsp_mm_less<srmatrix,simatrix,interval>(A,B);
2208 return spsp_mm_less<simatrix,simatrix,interval>(A,B);
2213 return spf_mm_less<srmatrix,imatrix,interval>(A,B);
2218 return spf_mm_less<simatrix,imatrix,interval>(A,B);
2223 return fsp_mm_less<rmatrix,simatrix,interval>(A,B);
2228 return fsp_mm_less<imatrix,simatrix,interval>(A,B);
2233 return fsp_mm_less<rmatrix_slice,simatrix,interval>(A,B);
2238 return fsp_mm_less<imatrix_slice,simatrix,interval>(A,B);
2243 return spf_mm_less<srmatrix,imatrix_slice,interval>(A,B);
2248 return spf_mm_less<simatrix,imatrix_slice,interval>(A,B);
2253 return spsp_mm_leq<srmatrix,simatrix,interval>(A,B);
2258 return spsp_mm_leq<simatrix,simatrix,interval>(A,B);
2263 return spf_mm_leq<srmatrix,imatrix,interval>(A,B);
2268 return spf_mm_leq<simatrix,imatrix,interval>(A,B);
2273 return fsp_mm_leq<rmatrix,simatrix,interval>(A,B);
2278 return fsp_mm_leq<imatrix,simatrix,interval>(A,B);
2283 return fsp_mm_leq<rmatrix_slice,simatrix,interval>(A,B);
2288 return fsp_mm_leq<imatrix_slice,simatrix,interval>(A,B);
2293 return spf_mm_leq<srmatrix,imatrix_slice,interval>(A,B);
2298 return spf_mm_leq<simatrix,imatrix_slice,interval>(A,B);
2303 return spsp_mm_greater<simatrix,srmatrix,interval>(A,B);
2308 return spsp_mm_greater<simatrix,simatrix,interval>(A,B);
2313 return spf_mm_greater<simatrix,rmatrix,interval>(A,B);
2318 return spf_mm_greater<simatrix,imatrix,interval>(A,B);
2323 return fsp_mm_greater<imatrix,srmatrix,interval>(A,B);
2328 return fsp_mm_greater<imatrix,simatrix,interval>(A,B);
2333 return fsp_mm_greater<imatrix_slice,srmatrix,interval>(A,B);
2338 return fsp_mm_greater<imatrix_slice,simatrix,interval>(A,B);
2343 return spf_mm_greater<simatrix,rmatrix_slice,interval>(A,B);
2348 return spf_mm_greater<simatrix,imatrix_slice,interval>(A,B);
2353 return spsp_mm_geq<simatrix,srmatrix,interval>(A,B);
2358 return spsp_mm_geq<simatrix,simatrix,interval>(A,B);
2363 return spf_mm_geq<simatrix,rmatrix,interval>(A,B);
2368 return spf_mm_geq<simatrix,imatrix,interval>(A,B);
2373 return fsp_mm_geq<imatrix,srmatrix,interval>(A,B);
2378 return fsp_mm_geq<imatrix,simatrix,interval>(A,B);
2383 return fsp_mm_geq<imatrix_slice,srmatrix,interval>(A,B);
2388 return fsp_mm_geq<imatrix_slice,simatrix,interval>(A,B);
2393 return spf_mm_geq<simatrix,rmatrix_slice,interval>(A,B);
2398 return spf_mm_geq<simatrix,imatrix_slice,interval>(A,B);
2412inline std::ostream& operator<<(std::ostream& os,
const simatrix& A) {
2413 return sp_m_output<simatrix,interval>(os,A);
2422inline std::istream& operator>>(std::istream& is,
simatrix& A) {
2423 return sp_m_input<simatrix,interval>(is,A);
2446 A.p = std::vector<int>(A.n+1, 0);
2447 A.ind.reserve(A.m + A.n);
2448 A.x.reserve(A.m + A.n);
2450 for(
int i=0 ; i<A.n ; i++) {
2452 for(
int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) {
2453 if(Mat.ind[j] >= sl1l-Mat.lb1 && Mat.ind[j] <= sl1u-Mat.lb1) {
2454 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1));
2455 A.x.push_back(Mat.x[j]);
2474 A.p = std::vector<int>(A.n+1, 0);
2475 A.ind.reserve(A.m + A.n);
2476 A.x.reserve(A.m + A.n);
2478 for(
int i=0 ; i<A.n ; i++) {
2480 for(
int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) {
2481 if(Mat.ind[j] >= sl1l-Mat.lb1 && Mat.ind[j] <= sl1u-Mat.lb1) {
2482 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1));
2483 A.x.push_back(Mat.x[j]);
2497 return sl_ms_assign<simatrix_slice, real, std::vector<interval>::iterator,
interval>(*
this,C);
2502 return sl_ms_assign<simatrix_slice, interval, std::vector<interval>::iterator,
interval>(*
this,C);
2507 return slsp_mm_assign<simatrix_slice, srmatrix, std::vector<interval>::iterator>(*
this,C);
2512 return slsp_mm_assign<simatrix_slice, simatrix, std::vector<interval>::iterator>(*
this,C);
2517 return slf_mm_assign<simatrix_slice, rmatrix, std::vector<interval>::iterator,
interval>(*
this,C);
2522 return slf_mm_assign<simatrix_slice, imatrix, std::vector<interval>::iterator,
interval>(*
this,C);
2527 return slf_mm_assign<simatrix_slice, rmatrix_slice, std::vector<interval>::iterator,
interval>(*
this,C);
2532 return slf_mm_assign<simatrix_slice, imatrix_slice, std::vector<interval>::iterator,
interval>(*
this,C);
2769#if(CXSC_INDEX_CHECK)
2770 if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2)
2771 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_slice::operator()(int, int)"));
2783#if(CXSC_INDEX_CHECK)
2784 if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2)
2785 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_slice::element(int, int)"));
2825#include "matrix_friend_declarations.inl"
2830 lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2;
2834 for(
int j=0 ; j<A.A.n ; j++) {
2835 for(
int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) {
2836 dat[A.A.ind[k]*A.A.n+j] = A.A.x[k];
2843 lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2;
2847 for(
int j=0 ; j<A.A.n ; j++) {
2848 for(
int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) {
2849 dat[A.A.ind[k]*A.A.n+j] = A.A.x[k];
2865#if(CXSC_INDEX_CHECK)
2866 if(i<lb1 || j>ub1 || k<lb2 || l>ub2)
2867 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator()(int, int, int, int)"));
2873#if(CXSC_INDEX_CHECK)
2874 if(i<lb1 || j>ub1 || k<lb2 || l>ub2)
2875 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator()(int, int, int, int) const"));
3057 return sp_m_negative<simatrix,simatrix>(M.A);
3073 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
3084 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
3095 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
3106 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2);
3117 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2);
3128 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2);
3139 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1,M2.A);
3150 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A);
3161 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A);
3172 return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(M1.A,M2);
3183 return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(M1.A,M2);
3194 return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(M1.A,M2);
3205 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A);
3216 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
3227 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
3238 return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(M1.A,M2);
3249 return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2);
3260 return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2);
3271 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A);
3282 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
3293 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
3304 return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(M.A,v);
3315 return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(M.A,v);
3326 return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(M.A,v);
3337 return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(M.A,v);
3348 return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v);
3359 return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v);
3370 return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(M.A,v);
3381 return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(M.A,v);
3392 return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(M.A,v);
3403 return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(M.A,v);
3414 return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(M.A,v);
3425 return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(M.A,v);
3430 return sp_ms_div<simatrix,real,simatrix>(M.A,r);
3435 return sp_ms_div<simatrix,interval,simatrix>(M.A,r);
3440 return sp_ms_div<srmatrix,interval,simatrix>(M.A,r);
3445 return sp_ms_mult<simatrix,real,simatrix>(M.A,r);
3450 return sp_ms_mult<simatrix,interval,simatrix>(M.A,r);
3455 return sp_ms_mult<srmatrix,interval,simatrix>(M.A,r);
3460 return sp_sm_mult<real,simatrix,simatrix>(r,M.A);
3465 return sp_sm_mult<interval,srmatrix,simatrix>(r,M.A);
3470 return sp_sm_mult<interval,simatrix,simatrix>(r,M.A);
3475 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
3480 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3485 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3490 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
3495 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
3500 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2);
3505 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
3510 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
3515 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1,M2.A);
3520 return spf_mm_add<simatrix,rmatrix,imatrix>(M1.A,M2);
3525 return spf_mm_add<srmatrix,imatrix,imatrix>(M1.A,M2);
3530 return spf_mm_add<simatrix,imatrix,imatrix>(M1.A,M2);
3535 return fsp_mm_add<imatrix,srmatrix,imatrix>(M1,M2.A);
3540 return fsp_mm_add<rmatrix,simatrix,imatrix>(M1,M2.A);
3545 return fsp_mm_add<imatrix,simatrix,imatrix>(M1,M2.A);
3550 return spf_mm_add<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
3555 return spf_mm_add<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
3560 return spf_mm_add<simatrix,imatrix_slice,imatrix>(M1.A,M2);
3565 return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
3570 return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
3575 return fsp_mm_add<imatrix_slice,simatrix,imatrix>(M1,M2.A);
3580 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
3585 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3590 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3595 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
3600 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
3605 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2);
3610 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
3615 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
3620 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1,M2.A);
3625 return spf_mm_sub<simatrix,rmatrix,imatrix>(M1.A,M2);
3630 return spf_mm_sub<srmatrix,imatrix,imatrix>(M1.A,M2);
3635 return spf_mm_sub<simatrix,imatrix,imatrix>(M1.A,M2);
3640 return fsp_mm_sub<imatrix,srmatrix,imatrix>(M1,M2.A);
3645 return fsp_mm_sub<rmatrix,simatrix,imatrix>(M1,M2.A);
3650 return fsp_mm_sub<imatrix,simatrix,imatrix>(M1,M2.A);
3655 return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
3660 return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
3665 return spf_mm_sub<simatrix,imatrix_slice,imatrix>(M1.A,M2);
3670 return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
3675 return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
3680 return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(M1,M2.A);
3685 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
3690 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3695 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3700 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
3705 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
3710 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2);
3715 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
3720 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
3725 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1,M2.A);
3730 return spf_mm_hull<simatrix,rmatrix,imatrix>(M1.A,M2);
3735 return spf_mm_hull<srmatrix,imatrix,imatrix>(M1.A,M2);
3740 return spf_mm_hull<simatrix,imatrix,imatrix>(M1.A,M2);
3745 return fsp_mm_hull<imatrix,srmatrix,imatrix>(M1,M2.A);
3750 return fsp_mm_hull<rmatrix,simatrix,imatrix>(M1,M2.A);
3755 return fsp_mm_hull<imatrix,simatrix,imatrix>(M1,M2.A);
3760 return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
3765 return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
3770 return spf_mm_hull<simatrix,imatrix_slice,imatrix>(M1.A,M2);
3775 return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
3780 return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
3785 return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(M1,M2.A);
3790 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
3795 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2);
3800 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1,M2.A);
3805 return spf_mm_hull<srmatrix,rmatrix,imatrix>(M1.A,M2);
3810 return fsp_mm_hull<rmatrix,srmatrix,imatrix>(M1,M2.A);
3815 return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(M1.A,M2);
3820 return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(M1,M2.A);
3825 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
3830 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2);
3835 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1,M2.A);
3840 return spf_mm_intersect<simatrix,imatrix,imatrix>(M1.A,M2);
3845 return fsp_mm_intersect<imatrix,simatrix,imatrix>(M1,M2.A);
3850 return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(M1.A,M2);
3855 return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(M1,M2.A);
3860 return spsp_mm_comp(M1.A,M2.A);
3865 return spsp_mm_comp(M1.A,M2.A);
3870 return spsp_mm_comp(M1.A,M2.A);
3875 return spsp_mm_comp(M1.A,M2);
3880 return spsp_mm_comp(M1.A,M2);
3885 return spsp_mm_comp(M1.A,M2);
3890 return spsp_mm_comp(M1,M2.A);
3895 return spsp_mm_comp(M1,M2.A);
3900 return spsp_mm_comp(M1,M2.A);
3905 return spf_mm_comp(M1.A,M2);
3910 return spf_mm_comp(M1.A,M2);
3915 return spf_mm_comp(M1.A,M2);
3920 return fsp_mm_comp(M1,M2.A);
3925 return fsp_mm_comp(M1,M2.A);
3930 return fsp_mm_comp(M1,M2.A);
3935 return fsp_mm_comp(M1,M2.A);
3940 return fsp_mm_comp(M1,M2.A);
3945 return fsp_mm_comp(M1,M2.A);
3950 return spf_mm_comp(M1.A,M2);
3955 return spf_mm_comp(M1.A,M2);
3960 return spf_mm_comp(M1.A,M2);
3965 return !spsp_mm_comp(M1.A,M2.A);
3970 return !spsp_mm_comp(M1.A,M2.A);
3975 return !spsp_mm_comp(M1.A,M2.A);
3980 return !spsp_mm_comp(M1.A,M2);
3985 return !spsp_mm_comp(M1.A,M2);
3990 return !spsp_mm_comp(M1.A,M2);
3995 return !spsp_mm_comp(M1,M2.A);
4000 return !spsp_mm_comp(M1,M2.A);
4005 return !spsp_mm_comp(M1,M2.A);
4010 return !spf_mm_comp(M1.A,M2);
4015 return !spf_mm_comp(M1.A,M2);
4020 return !spf_mm_comp(M1.A,M2);
4025 return !fsp_mm_comp(M1,M2.A);
4030 return !fsp_mm_comp(M1,M2.A);
4035 return !fsp_mm_comp(M1,M2.A);
4040 return !fsp_mm_comp(M1,M2.A);
4045 return !fsp_mm_comp(M1,M2.A);
4050 return !fsp_mm_comp(M1,M2.A);
4055 return !spf_mm_comp(M1.A,M2);
4060 return !spf_mm_comp(M1.A,M2);
4065 return !spf_mm_comp(M1.A,M2);
4070 return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2.A);
4075 return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2.A);
4080 return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2);
4085 return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2);
4090 return spsp_mm_less<srmatrix,simatrix,interval>(M1,M2.A);
4095 return spsp_mm_less<simatrix,simatrix,interval>(M1,M2.A);
4100 return spf_mm_less<srmatrix,imatrix,interval>(M1.A,M2);
4105 return spf_mm_less<simatrix,imatrix,interval>(M1.A,M2);
4110 return fsp_mm_less<rmatrix,simatrix,interval>(M1,M2.A);
4115 return fsp_mm_less<imatrix,simatrix,interval>(M1,M2.A);
4120 return fsp_mm_less<rmatrix_slice,simatrix,interval>(M1,M2.A);
4125 return fsp_mm_less<imatrix_slice,simatrix,interval>(M1,M2.A);
4130 return spf_mm_less<srmatrix,imatrix_slice,interval>(M1.A,M2);
4135 return spf_mm_less<simatrix,imatrix_slice,interval>(M1.A,M2);
4140 return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2.A);
4145 return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2.A);
4150 return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2);
4155 return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2);
4160 return spsp_mm_leq<srmatrix,simatrix,interval>(M1,M2.A);
4165 return spsp_mm_leq<simatrix,simatrix,interval>(M1,M2.A);
4170 return spf_mm_leq<srmatrix,imatrix,interval>(M1.A,M2);
4175 return spf_mm_leq<simatrix,imatrix,interval>(M1.A,M2);
4180 return fsp_mm_leq<rmatrix,simatrix,interval>(M1,M2.A);
4185 return fsp_mm_leq<imatrix,simatrix,interval>(M1,M2.A);
4190 return fsp_mm_leq<rmatrix_slice,simatrix,interval>(M1,M2.A);
4195 return fsp_mm_leq<imatrix_slice,simatrix,interval>(M1,M2.A);
4200 return spf_mm_leq<srmatrix,imatrix_slice,interval>(M1.A,M2);
4205 return spf_mm_leq<simatrix,imatrix_slice,interval>(M1.A,M2);
4210 return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2.A);
4215 return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2.A);
4220 return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2);
4225 return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2);
4230 return spsp_mm_greater<simatrix,srmatrix,interval>(M1,M2.A);
4235 return spsp_mm_greater<simatrix,simatrix,interval>(M1,M2.A);
4240 return spf_mm_greater<simatrix,rmatrix,interval>(M1.A,M2);
4245 return spf_mm_greater<simatrix,imatrix,interval>(M1.A,M2);
4250 return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A);
4255 return fsp_mm_greater<imatrix,simatrix,interval>(M1,M2.A);
4260 return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A);
4265 return fsp_mm_greater<imatrix_slice,simatrix,interval>(M1,M2.A);
4270 return spf_mm_greater<simatrix,rmatrix_slice,interval>(M1.A,M2);
4275 return spf_mm_greater<simatrix,imatrix_slice,interval>(M1.A,M2);
4280 return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2.A);
4285 return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2.A);
4290 return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2);
4295 return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2);
4300 return spsp_mm_geq<simatrix,srmatrix,interval>(M1,M2.A);
4305 return spsp_mm_geq<simatrix,simatrix,interval>(M1,M2.A);
4310 return spf_mm_geq<simatrix,rmatrix,interval>(M1.A,M2);
4315 return spf_mm_geq<simatrix,imatrix,interval>(M1.A,M2);
4320 return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A);
4325 return fsp_mm_geq<imatrix,simatrix,interval>(M1,M2.A);
4330 return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A);
4335 return fsp_mm_geq<imatrix_slice,simatrix,interval>(M1,M2.A);
4340 return spf_mm_geq<simatrix,rmatrix_slice,interval>(M1.A,M2);
4345 return spf_mm_geq<simatrix,imatrix_slice,interval>(M1.A,M2);
4350 return sp_m_not(M.A);
4360 return sp_m_output<simatrix,interval>(os, M.A);
4371 sp_m_input<simatrix,interval>(is, tmp);
4389 simatrix_subv(
simatrix& A,
bool r,
int i,
int j,
int k,
int l) : dat(A,i,j,k,l), row(r) {
4390 if(row) index=i;
else index=k;
4393 simatrix_subv(
const simatrix& A,
bool r,
int i,
int j,
int k,
int l) : dat(A,i,j,k,l), row(r) {
4394 if(row) index=i;
else index=k;
4405#if(CXSC_INDEX_CHECK)
4406 if(i<dat.A.lb2 || i>dat.A.ub2)
4407 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_subv::operator[](int)"));
4411#if(CXSC_INDEX_CHECK)
4412 if(i<dat.A.lb1 || i>dat.A.ub1)
4413 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_subv::operator[](int)"));
4425#if(CXSC_INDEX_CHECK)
4426 if(i<dat.A.lb2 || i>dat.A.ub2)
4427 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_subv::operator[](int)"));
4429 return dat(index,i);
4431#if(CXSC_INDEX_CHECK)
4432 if(i<dat.A.lb1 || i>dat.A.ub1)
4433 cxscthrow(ELEMENT_NOT_IN_VEC(
"simatrix_subv::operator[](int)"));
4435 return dat(i,index);
4441 return sv_vs_assign(*
this,v);
4446 return sv_vs_assign(*
this,v);
4451 return svsp_vv_assign(*
this,v);
4456 return svsp_vv_assign(*
this,v);
4461 return svsl_vv_assign(*
this,v);
4466 return svsl_vv_assign(*
this,v);
4471 return svf_vv_assign(*
this,v);
4476 return svf_vv_assign(*
this,v);
4481 return svf_vv_assign(*
this,v);
4486 return svf_vv_assign(*
this,v);
4491 return svsp_vv_assign(*
this,
srvector(v));
4496 return svsp_vv_assign(*
this,
sivector(v));
4576#include "vector_friend_declarations.inl"
4582 return Lb(S.dat, 2);
4584 return Lb(S.dat, 1);
4590 return Ub(S.dat, 2);
4592 return Ub(S.dat, 1);
4597 return Ub(S)-
Lb(S)+1;
4634 if(v.row) n=v.dat.A.n;
else n=v.dat.A.m;
4642#if(CXSC_INDEX_CHECK)
4643 if(c.col()<lb2 || c.col()>ub2)
4644 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const cxscmatrix_column&)"));
4646 return simatrix_subv(*
this,
false, lb1, ub1, c.col(), c.col());
4650#if(CXSC_INDEX_CHECK)
4652 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const int)"));
4658#if(CXSC_INDEX_CHECK)
4659 if(c.col()<lb2 || c.col()>ub2)
4660 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const cxscmatrix_column&)"));
4662 return simatrix_subv(*
this,
false, lb1, ub1, c.col(), c.col());
4666#if(CXSC_INDEX_CHECK)
4668 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const int)"));
4674#if(CXSC_INDEX_CHECK)
4675 if(i<A.lb1 || i>A.ub1)
4676 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const int"));
4682#if(CXSC_INDEX_CHECK)
4683 if(c.col()<A.lb2 || c.col()>A.ub2)
4684 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const cxscmatrix_column&)"));
4686 return simatrix_subv(*M,
false, A.lb1, A.ub1, c.col(), c.col());
4690#if(CXSC_INDEX_CHECK)
4691 if(i<A.lb1 || i>A.ub1)
4692 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const int"));
4698#if(CXSC_INDEX_CHECK)
4699 if(c.col()<A.lb2 || c.col()>A.ub2)
4700 cxscthrow(ROW_OR_COL_NOT_IN_MAT(
"simatrix::operator[](const cxscmatrix_column&)"));
4702 return simatrix_subv(*M,
false, A.lb1, A.ub1, c.col(), c.col());
4715 for(
int j=0 ; j<n ; j++) {
4716 for(
int k=A.dat.A.p[j] ; k<A.dat.A.p[j+1] ; k++) {
4718 x.push_back(A.dat.A.x[k]);
4727 for(
unsigned int k=0 ; k<A.dat.A.ind.size() ; k++) {
4728 p.push_back(A.dat.A.ind[k]);
4729 x.push_back(A.dat.A.x[k]);
6309 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot,
sivector(v1),
sivector(v2));
6317 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot,
sivector(v1),
srvector(v2));
6325 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot,
srvector(v1),
sivector(v2));
6333 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot,
sivector(v1), v2);
6341 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot,
sivector(v1), v2);
6349 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot,
srvector(v1), v2);
6357 spsl_vv_accu<idotprecision,sivector,sivector_slice,sparse_idot>(dot,
sivector(v1), v2);
6365 spsl_vv_accu<idotprecision,sivector,srvector_slice,sparse_idot>(dot,
sivector(v1), v2);
6373 spsl_vv_accu<idotprecision,srvector,sivector_slice,sparse_idot>(dot,
srvector(v1), v2);
6381 spf_vv_accu<idotprecision,sivector,ivector,sparse_idot>(dot,
sivector(v1), v2);
6389 spf_vv_accu<idotprecision,sivector,rvector,sparse_idot>(dot,
sivector(v1), v2);
6397 spf_vv_accu<idotprecision,srvector,ivector,sparse_idot>(dot,
srvector(v1), v2);
6405 spf_vv_accu<idotprecision,sivector,ivector_slice,sparse_idot>(dot,
sivector(v1), v2);
6413 spf_vv_accu<idotprecision,sivector,rvector_slice,sparse_idot>(dot,
sivector(v1), v2);
6421 spf_vv_accu<idotprecision,srvector,ivector_slice,sparse_idot>(dot,
srvector(v1), v2);
6429 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, v1,
sivector(v2));
6437 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, v1,
srvector(v2));
6445 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, v1,
sivector(v2));
6453 slsp_vv_accu<idotprecision,sivector_slice,sivector,sparse_idot>(dot, v1,
sivector(v2));
6461 slsp_vv_accu<idotprecision,sivector_slice,srvector,sparse_idot>(dot, v1,
srvector(v2));
6469 slsp_vv_accu<idotprecision,srvector_slice,sivector,sparse_idot>(dot, v1,
sivector(v2));
6477 fsp_vv_accu<idotprecision,ivector,sivector,sparse_idot>(dot, v1,
sivector(v2));
6485 fsp_vv_accu<idotprecision,ivector,srvector,sparse_idot>(dot, v1,
srvector(v2));
6493 fsp_vv_accu<idotprecision,rvector,sivector,sparse_idot>(dot, v1,
sivector(v2));
6501 fsp_vv_accu<idotprecision,ivector_slice,sivector,sparse_idot>(dot, v1,
sivector(v2));
6509 fsp_vv_accu<idotprecision,ivector_slice,srvector,sparse_idot>(dot, v1,
srvector(v2));
6517 fsp_vv_accu<idotprecision,rvector_slice,sivector,sparse_idot>(dot, v1,
sivector(v2));
6528 SetRe(dot, Re(dot) + tmp);
6539 SetRe(dot, Re(dot) + tmp);
6550 SetRe(dot, Re(dot) + tmp);
6561 SetRe(dot, Re(dot) + tmp);
6572 SetRe(dot, Re(dot) + tmp);
6583 SetRe(dot, Re(dot) + tmp);
6594 SetRe(dot, Re(dot) + tmp);
6605 SetRe(dot, Re(dot) + tmp);
6616 SetRe(dot, Re(dot) + tmp);
6627 SetRe(dot, Re(dot) + tmp);
6638 SetRe(dot, Re(dot) + tmp);
6649 SetRe(dot, Re(dot) + tmp);
6660 SetRe(dot, Re(dot) + tmp);
6671 SetRe(dot, Re(dot) + tmp);
6682 SetRe(dot, Re(dot) + tmp);
6693 SetRe(dot, Re(dot) + tmp);
6704 SetRe(dot, Re(dot) + tmp);
6715 SetRe(dot, Re(dot) + tmp);
6726 SetRe(dot, Re(dot) + tmp);
6737 SetRe(dot, Re(dot) + tmp);
6748 SetRe(dot, Re(dot) + tmp);
6759 SetRe(dot, Re(dot) + tmp);
6770 SetRe(dot, Re(dot) + tmp);
6781 SetRe(dot, Re(dot) + tmp);
6792 SetRe(dot, Re(dot) + tmp);
6803 SetRe(dot, Re(dot) + tmp);
6814 SetRe(dot, Re(dot) + tmp);
6819#include "sparsematrix.inl"
The Data Type cidotprecision.
int get_k() const
Get currently set precision for computation of dot products.
The Data Type idotprecision.
void set_k(unsigned int i)
Set precision for computation of dot products.
The Data Type imatrix_slice.
imatrix_slice & operator+=(const imatrix &m1) noexcept
Implementation of addition and allocation operation.
imatrix_slice & operator|=(const imatrix &m1) noexcept
Allocates the convex hull of the arguments to the first argument.
imatrix_slice & operator&=(const imatrix &m1) noexcept
Allocates the intersection of the arguments to the first argument.
imatrix_slice & operator-=(const imatrix &m1) noexcept
Implementation of subtraction and allocation operation.
imatrix_slice & operator*=(const imatrix &m) noexcept
Implementation of multiplication and allocation operation.
The Data Type imatrix_subv.
imatrix_subv & operator|=(const sivector &rv)
Implementation of addition and allocation operation.
imatrix_subv & operator+=(const interval &c) noexcept
Implementation of addition and allocation operation.
imatrix_subv & operator-=(const interval &c) noexcept
Implementation of subtraction and allocation operation.
imatrix_subv & operator&=(const sivector &rv)
Implementation of subtraction and allocation operation.
imatrix_subv & operator=(const simatrix_subv &rv)
Implementation of standard assigning operator.
imatrix & operator+=(const simatrix &)
Implementation of addition and assignment operator.
imatrix & operator=(const interval &r) noexcept
Implementation of standard assigning operator.
imatrix() noexcept
Constructor of class imatrix.
imatrix & operator&=(const simatrix &)
Implementation of intersection and assignment operator.
imatrix & operator-=(const simatrix &)
Implementation of substraction and assignment operator.
imatrix & operator*=(const simatrix &)
Implementation of product and assignment operator.
imatrix & operator|=(const simatrix &)
Implementation of convex hull and assignment operator.
The Scalar Type interval.
The Data Type ivector_slice.
The Data Type rmatrix_slice.
The Data Type rvector_slice.
A slice of a sparse complex interval matrix.
Represents a row or column vector of a sparse matrix.
A sparse complex interval matrix.
A sparse complex interval vector.
A slice of a sparse real interval matrix.
simatrix_slice & operator+=(const rmatrix &M)
Assigns the element wise sum of the sparse slice and M to the slice.
friend int ColLen(const simatrix_slice &)
Returns the number of rows of the matrix slice.
simatrix_slice & operator|=(const imatrix &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator|=(const rmatrix &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator|=(const simatrix_slice &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator*=(const imatrix &M)
Assigns the product of the sparse slice and M to the slice.
simatrix_slice & operator=(const srmatrix &C)
Assing C to the slice.
simatrix_slice & operator|=(const simatrix &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator/=(const real &r)
Assigns the component wise division of the sparse slice and M to the slice.
simatrix_slice & operator-=(const srmatrix &M)
Assigns the element wise difference of the sparse slice and M to the slice.
simatrix_slice & operator|=(const srmatrix_slice &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
interval & element(const int i, const int j)
Returns a reference to the element (i,j) of the matrix.
simatrix_slice & operator=(const rmatrix &C)
Assing C to the slice.
simatrix_slice & operator*=(const simatrix_slice &M)
Assigns the product of the sparse slice and M to the slice.
simatrix_slice & operator-=(const imatrix &M)
Assigns the element wise difference of the sparse slice and M to the slice.
friend srmatrix diam(const simatrix_slice &)
Returns the elementwise diameter of S.
simatrix_slice & operator=(const real &C)
Assing C to all elements of the slice.
simatrix_slice & operator=(const interval &C)
Assing C to all elements of the slice.
simatrix_slice & operator-=(const rmatrix &M)
Assigns the element wise difference of the sparse slice and M to the slice.
simatrix_slice & operator+=(const srmatrix_slice &M)
Assigns the element wise sum of the sparse slice and M to the slice.
friend int Lb(const simatrix_slice &, const int)
Returns the lower index bound of the rows (if i==ROW) or columns (if i==COL) of the slice.
simatrix_slice & operator+=(const simatrix_slice &M)
Assigns the element wise sum of the sparse slice and M to the slice.
simatrix_slice & operator=(const srmatrix_slice &C)
Assing C to the slice.
simatrix_slice & operator*=(const imatrix_slice &M)
Assigns the product of the sparse slice and M to the slice.
friend int Ub(const simatrix_slice &, const int)
Returns the upper index bound of the rows (if i==ROW) or columns (if i==COL) of the slice.
friend int RowLen(const simatrix_slice &)
Returns the number columns of the matrix slice.
simatrix_slice & operator=(const simatrix &C)
Assing C to the slice.
friend simatrix abs(const simatrix_slice &)
Returns the elementwise absolute value of S.
simatrix_slice & operator*=(const srmatrix_slice &M)
Assigns the product of the sparse slice and M to the slice.
simatrix_slice & operator-=(const srmatrix_slice &M)
Assigns the element wise difference of the sparse slice and M to the slice.
simatrix_slice & operator-=(const simatrix_slice &M)
Assigns the element wise difference of the sparse slice and M to the slice.
simatrix_subv operator[](const int)
Returns a row of the matrix.
simatrix_slice & operator=(const imatrix &C)
Assing C to the slice.
simatrix_slice & operator+=(const srmatrix &M)
Assigns the element wise sum of the sparse slice and M to the slice.
simatrix_slice & operator-=(const simatrix &M)
Assigns the element wise difference of the sparse slice and M to the slice.
simatrix_slice & operator+=(const imatrix_slice &M)
Assigns the element wise sum of the sparse slice and M to the slice.
simatrix_slice & operator=(const rmatrix_slice &C)
Assing C to the slice.
simatrix_slice & operator=(const imatrix_slice &C)
Assing C to the slice.
simatrix_slice & operator+=(const simatrix &M)
Assigns the element wise sum of the sparse slice and M to the slice.
simatrix_slice & operator*=(const interval &r)
Assigns the component wise product of the sparse slice and r to the slice.
simatrix_slice & operator*=(const real &r)
Assigns the component wise product of the sparse slice and r to the slice.
simatrix_slice & operator*=(const simatrix &M)
Assigns the product of the sparse slice and M to the slice.
const interval operator()(const int i, const int j) const
Returns a copy of the element (i,j) of the matrix.
simatrix_slice & operator*=(const srmatrix &M)
Assigns the product of the sparse slice and M to the slice.
simatrix_slice & operator-=(const rmatrix_slice &M)
Assigns the element wise difference of the sparse slice and M to the slice.
friend srmatrix Sup(const simatrix_slice &)
Returns the supremum of the slice S.
friend srmatrix mid(const simatrix_slice &)
Returns the elementwise midpoint of S.
simatrix_slice & operator*=(const rmatrix_slice &M)
Assigns the product of the sparse slice and M to the slice.
friend srmatrix Inf(const simatrix_slice &)
Returns the infimum of the slice S.
simatrix_slice & operator|=(const rmatrix_slice &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator*=(const rmatrix &M)
Assigns the product of the sparse slice and M to the slice.
simatrix_slice & operator|=(const imatrix_slice &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator+=(const imatrix &M)
Assigns the element wise sum of the sparse slice and M to the slice.
simatrix_slice & operator=(const simatrix_slice &C)
Assing C to the slice.
simatrix_slice & operator|=(const srmatrix &M)
Assigns the element wise convex hull of the sparse slice and M to the slice.
simatrix_slice & operator/=(const interval &r)
Assigns the component wise division of the sparse slice and M to the slice.
simatrix_slice & operator-=(const imatrix_slice &M)
Assigns the element wise difference of the sparse slice and M to the slice.
friend std::ostream & operator<<(std::ostream &, const simatrix_slice &)
Standard output operator for sparse matrix slice.
simatrix_slice & operator+=(const rmatrix_slice &M)
Assigns the element wise sum of the sparse slice and M to the slice.
Represents a row or column vector of a sparse matrix.
simatrix_subv & operator=(const ivector &v)
Assigns a vector to a subvector.
friend srvector Sup(const simatrix_subv &)
Returns the supremum of the subvector.
simatrix_subv & operator=(const rvector_slice &v)
Assigns a vector to a subvector.
friend sivector operator-(const simatrix_subv &)
Unary negation operator.
friend int Ub(const simatrix_subv &)
Returns the upper index bound of the subvector.
simatrix_subv & operator+=(const srvector &)
Assign the sum of the subvector with a vector to the subvector.
simatrix_subv & operator=(const simatrix_subv &v)
Assigns a vector to a subvector.
simatrix_subv & operator=(const sivector &v)
Assigns a vector to a subvector.
simatrix_subv & operator=(const srvector &v)
Assigns a vector to a subvector.
simatrix_subv & operator=(const ivector_slice &v)
Assigns a vector to a subvector.
simatrix_subv & operator|=(const srvector &)
Assign the convex hull of the subvector and a vector to the subvector.
simatrix_subv & operator=(const srvector_slice &v)
Assigns a vector to a subvector.
const interval operator[](const int i) const
Returns a copy of the i-th element of the subvector.
friend int Lb(const simatrix_subv &)
Returns the lower index bound of the subvector.
friend srvector Inf(const simatrix_subv &)
Returns the infimum of the subvector.
simatrix_subv & operator*=(const real &)
Assign the componentwise product of the subvector with a scalar to the subvector.
simatrix_subv & operator=(const interval &v)
Assigns v to all elements of the subvector.
friend std::istream & operator>>(std::istream &, simatrix_subv &)
Standard input operator for subvectors.
friend int VecLen(const simatrix_subv &)
Returns the length of the subvector.
simatrix_subv & operator=(const sivector_slice &v)
Assigns a vector to a subvector.
simatrix_subv & operator=(const real &v)
Assigns v to all elements of the subvector.
simatrix_subv & operator-=(const srvector &)
Assign the difference of the subvector with a vector to the subvector.
simatrix_subv & operator/=(const real &)
Assign the componentwise division of the subvector with a scalar to the subvector.
simatrix_subv & operator=(const srmatrix_subv &v)
Assigns a vector to a subvector.
interval & operator[](const int i)
Returns a reference to the i-th element of the subvector.
simatrix_subv & operator=(const rvector &v)
Assigns a vector to a subvector.
A sparse interval matrix.
simatrix(const imatrix &A)
Creates a sparse matrix out of a dense matrix A. Only the non zero elements of A are stored explicitl...
int get_nnz() const
Returns the number of non-zero entries (including explicitly stored zeros).
void dropzeros()
Drops explicitly stored zeros from the data structure.
simatrix & operator-=(const imatrix &B)
Subtract B from the sparse matrix and assign the result to it.
simatrix & operator*=(const srmatrix &B)
Multiply the sparse matrix by B and assign the result to it.
simatrix & operator&=(const simatrix &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator|=(const srmatrix &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
friend srmatrix absmin(const simatrix &)
Returns the componentwise minimum absolute value.
simatrix(const int m, const int n, const int nnz, const intvector &rows, const intvector &cols, const ivector &values, const enum STORAGE_TYPE t=triplet)
Creates a sparse matrix out of three vectors (arrays) forming a matrix stored in triplet,...
simatrix & operator*=(const interval &r)
Multiply all elements of the sparse matrix by r and assign the result to it.
friend srmatrix Inf(const simatrix &)
Returns the Infimum of the matrix A.
friend void SetLb(simatrix &, const int, const int)
Sets the lower index bound of the rows (i==ROW) or columns (i==COL) to j.
simatrix & operator=(const rmatrix_slice &A)
Assigns a dense matrix slice to the sparse matrix. Only the non zero entries of the dense matrix are ...
std::vector< int > & row_indices()
Returns a reference to the vector containing the row indices (the array)
simatrix & operator+=(const rmatrix &B)
Add B to the sparse matrix and assign the result to it.
friend simatrix Id(const simatrix &)
Return a sparse unity matrix of the same dimension as A.
friend int ColLen(const simatrix &)
Returns the number of rows of the matrix.
void full(imatrix &A) const
Creates a full matrix out of the sparse matrix and stores it in A. This should normally be done using...
simatrix & operator=(const real &A)
Assigns a real value to all elements of the matrix (resulting in a dense matrix!)
simatrix & operator*=(const rmatrix &B)
Multiply the sparse matrix by B and assign the result to it.
simatrix operator()(const intvector &pervec, const intvector &q)
Performs a row and column permutation using two permutation vectors.
simatrix & operator*=(const imatrix &B)
Multiply the sparse matrix by B and assign the result to it.
friend simatrix abs(const simatrix &)
Returns the componentwise absolute value as the interval hull of .
simatrix & operator-=(const rmatrix_slice &B)
Subtract B from the sparse matrix and assign the result to it.
friend srmatrix absmax(const simatrix &)
Returns the componentwise maximum absolute value.
friend int Lb(const simatrix &, int)
Returns the lower index bound for the rows or columns of A.
simatrix(const srmatrix &A)
Creates a sparse interval matrix out of a sparse real matrix A.
simatrix & operator|=(const rmatrix &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator|=(const imatrix_slice &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator=(const imatrix_slice &A)
Assigns a dense matrix slice to the sparse matrix. Only the non zero entries of the dense matrix are ...
simatrix & operator=(const srmatrix &A)
Assign a sparse real to a sparse interval matrix.
simatrix & operator*=(const real &r)
Multiply all elements of the sparse matrix by r and assign the result to it.
friend std::istream & operator>>(std::istream &, simatrix_slice &)
Standard input operator for sparse matrix slice.
const std::vector< int > & column_pointers() const
Returns a constant reference to the vector containing the column pointers (the array)
simatrix(const int r, const int c, const int e)
Creates an empty matrix with r rows and c columns, pre-reserving space for e elements.
std::vector< int > & column_pointers()
Returns a reference to the vector containing the column pointers (the array)
simatrix & operator&=(const imatrix_slice &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator-=(const srmatrix &B)
Subtract B from the sparse matrix and assign the result to it.
simatrix & operator+=(const simatrix &B)
Add B to the sparse matrix and assign the result to it.
simatrix & operator|=(const imatrix &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator+=(const imatrix &B)
Add B to the sparse matrix and assign the result to it.
friend int Ub(const simatrix &, int)
Returns the upper index bound for the rows or columns of A.
friend srmatrix diam(const simatrix &)
Returns the componentwise diameter of A.
simatrix & operator+=(const srmatrix &B)
Add B to the sparse matrix and assign the result to it.
simatrix & operator+=(const rmatrix_slice &B)
Add B to the sparse matrix and assign the result to it.
simatrix & operator/=(const interval &r)
Divide all elements of the sparse matrix by r and assign the result to it.
simatrix & operator&=(const imatrix &B)
Form the intersection of a sparse matrix and B and assign the result to it.
simatrix & operator|=(const simatrix &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
friend simatrix Im(const scimatrix &)
Returns the imaginary part of the matrix A.
simatrix & operator/=(const real &r)
Divide all elements of the sparse matrix by r and assign the result to it.
simatrix(const int ms, const int ns, const imatrix &A)
Constructor for banded matrices.
friend srmatrix CompMat(const simatrix &)
Returns Ostroswkis comparison matrix for A.
simatrix & operator*=(const imatrix_slice &B)
Multiply the sparse matrix by B and assign the result to it.
simatrix & operator-=(const simatrix &B)
Subtract B from the sparse matrix and assign the result to it.
const interval operator()(int i, int j) const
Returns a copy of the element in row i and column j.
simatrix()
Standard constructor, creates an empty matrix of dimension 0x0.
simatrix & operator=(const imatrix &A)
Assigns a dense matrix to the sparse matrix. Only the non zero entries of the dense matrix are used.
friend int RowLen(const simatrix &)
Returns the number of columns of the matrix.
friend void SetUb(simatrix &, const int, const int)
Sets the upper index bound of the rows (i==ROW) or columns (i==COL) to j.
simatrix operator()(const intmatrix &P, const intmatrix &Q)
Performs row and column permutations using the two permutation matrices P and Q. Faster than explicit...
simatrix(const rmatrix &A)
Creates a sparse matrix out of a dense matrix A. Only the non zero elements of A are stored explicitl...
friend srmatrix mid(const simatrix &)
Returns the midpoint matrix for A.
simatrix & operator-=(const rmatrix &B)
Subtract B from the sparse matrix and assign the result to it.
simatrix & operator*=(const simatrix &B)
Multiply the sparse matrix by B and assign the result to it.
const std::vector< int > & row_indices() const
Returns a constant reference to the vector containing the row indices (the array)
const std::vector< interval > & values() const
Returns a constant reference to the vector containing the stored values (the array)
friend simatrix transp(const simatrix &)
Returns the transpose of A.
simatrix & operator-=(const imatrix_slice &B)
Subtract B from the sparse matrix and assign the result to it.
real density() const
Returns the density (the number of non-zeros divided by the number of elements) of the matrix.
simatrix & operator+=(const imatrix_slice &B)
Add B to the sparse matrix and assign the result to it.
simatrix & operator*=(const rmatrix_slice &B)
Multiply the sparse matrix by B and assign the result to it.
simatrix & operator=(const rmatrix &A)
Assigns a dense matrix to the sparse matrix. Only the non zero entries of the dense matrix are used.
friend simatrix Re(const scimatrix &)
Returns the real part of the matrix A.
simatrix & operator|=(const rmatrix_slice &B)
Form the convex hull of a sparse matrix and B and assign the result to it.
simatrix & operator=(const interval &A)
Assigns an interval value to all elements of the matrix (resulting in a dense matrix!...
friend srmatrix Sup(const simatrix &)
Returns the Supremum of the matrix A.
std::vector< interval > & values()
Returns a reference to the vector containing the stored values (the array)
simatrix operator()(const intmatrix &P)
Performs a row permutation using the permutation matrix P. Faster than explicitly computing the produ...
simatrix operator()(const intvector &pervec)
Performs a row permutation using a permutation vector.
simatrix(const int m, const int n, const int nnz, const int *rows, const int *cols, const interval *values, const enum STORAGE_TYPE t=triplet)
Creates a sparse matrix out of three arrays forming a matrix stored in triplet, compressed row or com...
simatrix(const int r, const int c)
Creates an empty matrix with r rows and c columns, pre-reserving space for 2*(r+c) elements.
simatrix_subv operator[](const cxscmatrix_column &)
Returns a column of the matrix as a sparse subvector object.
interval & element(int i, int j)
Returns a reference to the element (i,j) of the matrix.
Helper class for slices of sparse vectors.
A sparse interval vector.
sivector()
Default constructor, creates an empty vector of size 0.
A slice of a sparse real matrix.
Represents a row or column vector of a sparse matrix.
void dropzeros()
Drops explicitly stored zeros from the data structure.
int get_nnz() const
Returns the number of non-zero entries (including explicitly stored zeros).
Helper class for slices of sparse vectors.
The namespace cxsc, providing all functionality of the class library C-XSC.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
int ColLen(const cimatrix &)
Returns the column dimension.
rmatrix CompMat(const cimatrix &A)
Returns Ostrowski's comparison matrix.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
cimatrix transp(const cimatrix &A)
Returns the transposed matrix.
cvector diam(const cimatrix_subv &mv) noexcept
Returns the diameter of the matrix.
rvector absmax(const imatrix_subv &mv) noexcept
Returns the absolute maximum value of the matrix.
int Ub(const cimatrix &rm, const int &i) noexcept
Returns the upper bound index.
cimatrix & SetLb(cimatrix &m, const int &i, const int &j) noexcept
Sets the lower bound index.
int RowLen(const cimatrix &)
Returns the row dimension.
rvector absmin(const imatrix_subv &mv) noexcept
Returns the absolute minimum value of the matrix.
STORAGE_TYPE
Enumeration depicting the storage type of a sparse matrix (Triplet storage, Compressed column storage...
cimatrix Id(const cimatrix &A)
Returns the Identity matrix.
real AbsMax(const interval &x)
Computes the greatest absolute value .
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
cvector mid(const cimatrix_subv &mv) noexcept
Returns the middle of the matrix.
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
void Resize(cimatrix &A) noexcept
Resizes the matrix.
cimatrix & SetUb(cimatrix &m, const int &i, const int &j) noexcept
Sets the upper bound index.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.
real AbsMin(const interval &x)
Computes the smallest absolute value .