File: package-summary.html

package info (click to toggle)
libcolt-free-java 1.2.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,832 kB
  • sloc: java: 30,337; xml: 893; makefile: 26; sh: 3
file content (958 lines) | stat: -rw-r--r-- 46,241 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_05) on Thu Sep 09 20:36:06 PDT 2004 -->
<TITLE>
cern.colt.matrix (Colt 1.2.0 - API Specification)
</TITLE>

<META NAME="keywords" CONTENT="cern.colt.matrix package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="cern.colt.matrix (Colt 1.2.0 - API Specification)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Colt 1.2.0</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../cern/colt/map/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../cern/colt/matrix/bench/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<H2>
Package cern.colt.matrix
</H2>
Matrix <i>interfaces and factories</i>; efficient and flexible dense and sparse 
1, 2, 3 and d-dimensional matrices holding objects or primitive data types such 
as <tt>int</tt>, <tt>double</tt>, etc; Templated, fixed sized (not dynamically 
resizable); Also known as <i>multi-dimensional arrays</i> or<i> Data Cubes</i>.
<P>
<B>See:</B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>

<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix1DProcedure.html" title="interface in cern.colt.matrix">DoubleMatrix1DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix2DProcedure.html" title="interface in cern.colt.matrix">DoubleMatrix2DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix3DProcedure.html" title="interface in cern.colt.matrix">DoubleMatrix3DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix1DProcedure.html" title="interface in cern.colt.matrix">ObjectMatrix1DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix2DProcedure.html" title="interface in cern.colt.matrix">ObjectMatrix2DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix3DProcedure.html" title="interface in cern.colt.matrix">ObjectMatrix3DProcedure</A></B></TD>
<TD>Interface that represents a condition or procedure object: takes 
 a single argument and returns a boolean value.</TD>
</TR>
</TABLE>
&nbsp;

<P>

<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleFactory1D.html" title="class in cern.colt.matrix">DoubleFactory1D</A></B></TD>
<TD>Factory for convenient construction of 1-d matrices holding <tt>double</tt> cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleFactory2D.html" title="class in cern.colt.matrix">DoubleFactory2D</A></B></TD>
<TD>Factory for convenient construction of 2-d matrices holding <tt>double</tt> 
  cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleFactory3D.html" title="class in cern.colt.matrix">DoubleFactory3D</A></B></TD>
<TD>Factory for convenient construction of 3-d matrices holding <tt>double</tt> cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix1D.html" title="class in cern.colt.matrix">DoubleMatrix1D</A></B></TD>
<TD>Abstract base class for 1-d matrices (aka <i>vectors</i>) holding <tt>double</tt> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix2D.html" title="class in cern.colt.matrix">DoubleMatrix2D</A></B></TD>
<TD>Abstract base class for 2-d matrices holding <tt>double</tt> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/DoubleMatrix3D.html" title="class in cern.colt.matrix">DoubleMatrix3D</A></B></TD>
<TD>Abstract base class for 3-d matrices holding <tt>double</tt> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectFactory1D.html" title="class in cern.colt.matrix">ObjectFactory1D</A></B></TD>
<TD>Factory for convenient construction of 1-d matrices holding <tt>Object</tt> cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectFactory2D.html" title="class in cern.colt.matrix">ObjectFactory2D</A></B></TD>
<TD>Factory for convenient construction of 2-d matrices holding <tt>Object</tt> 
  cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectFactory3D.html" title="class in cern.colt.matrix">ObjectFactory3D</A></B></TD>
<TD>Factory for convenient construction of 3-d matrices holding <tt>Object</tt> cells.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix1D.html" title="class in cern.colt.matrix">ObjectMatrix1D</A></B></TD>
<TD>Abstract base class for 1-d matrices (aka <i>vectors</i>) holding <tt>Object</tt> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix2D.html" title="class in cern.colt.matrix">ObjectMatrix2D</A></B></TD>
<TD>Abstract base class for 2-d matrices holding <tt>Object</tt> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../cern/colt/matrix/ObjectMatrix3D.html" title="class in cern.colt.matrix">ObjectMatrix3D</A></B></TD>
<TD>Abstract base class for 3-d matrices holding <tt>Object</tt> elements.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package cern.colt.matrix Description
</H2>

<P>
Matrix <i>interfaces and factories</i>; efficient and flexible dense and sparse 
1, 2, 3 and d-dimensional matrices holding objects or primitive data types such 
as <tt>int</tt>, <tt>double</tt>, etc; Templated, fixed sized (not dynamically 
resizable); Also known as <i>multi-dimensional arrays</i> or<i> Data Cubes</i>. 
Note that d-dimensional and <tt>int</tt> based matrices are not yet provided. 
<p></p>
<h1><a name="Overview"></a>Getting Started</h1>
<ol>
  <li><a href="#Overview">Overview</a></li>
  <li><a href="#Introduction">Introduction</a> </li>
  <li><a href="#SemanticsOfViews">Semantics of Views</a></li>
  <li><a href="#FunctionObjects">Functional Programming with Objects</a></li>
  <li><a href="#Algorithms">Algorithms</a></li>
  <li><a href="#LinearAlgebra">Linear Algebra</a></li>
  <li><a href="#Orthogonality">Orthogonality and Polymorphism</a></li>
  <li><a href="#PackageOrganization">Package Organization, Naming Conventions, 
    Policies</a></li>
  <li><a href="#Performance">Performance</a></li>
  <li><a href="#Notes">Notes</a> </li>
</ol>
<h2></h2>
<h2>1. Overview</h2>
<p>The matrix package offers flexible object oriented abstractions modelling multi-dimensional 
  arrays, resembling the way they can be manipulated in Fortran. It is designed 
  to be scalable, not only in terms of performance and memory requirements, but 
  also in terms of the number of operations that make sense on such data structures. 
  Features include</p>
<table width="75%" border="0" bgcolor="#EEEEEE">
  <tr valign="top" align="left"> 
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Multi-dimensional Array 
              Types</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td align="LEFT" width="180"> 
            <ul>
              <li>dense 
              <li>sparse hashed 
              <li>sparse row compressed
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li>1-d, 2-d, 3-d
            </ul>
          </td>
        </tr>
      </table>
    </td>
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Matrix Operations</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td align="LEFT" width="180"> 
            <ul>
              <li>matrix-matrix multiply 
              <li>matrix-vector multiply 
              <li>inner, outer products 
              <li>tranposition 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li>equation solving 
              <li>permutation (pivoting)
              <li>integer powers 
              <li>norms 
              <li>trace 
            </ul>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr valign="top" align="left"> 
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Array Views (by Reference)</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td align="LEFT" width="180"> 
            <ul>
              <li>sub-range 
              <li>slice 
              <li>dice 
              <li>flip 
              <li>stride 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li>selection 
              <li>sort 
            </ul>
            <ul>
              <li>assigment 
              <li>copying 
            </ul>
          </td>
        </tr>
      </table>
    </td>
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td valign="MIDDLE" colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Matrix Factorizations and 
              Decompositions</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td width="180" align="LEFT"> 
            <ul>
              <li>LU 
              <li>QR 
              <li>Cholesky 
              <li>eigenvectors and eigenvalues 
              <li>singular value (SVD) 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li> inverse 
              <li>pseudoinverse 
              <li>condition 
              <li>determinant 
              <li>rank 
            </ul>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr valign="top" align="left"> 
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Elementwise Array Operations</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td align="LEFT" width="180"> 
            <ul>
              <li>addition 
              <li>subtraction 
              <li>multiplication 
              <li>division 
              <li>power 
              <li>square root 
              <li>logarithm 
              <li>exponential 
              <li>absolute value 
              <li>trigonometric functions 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li> assignment 
              <li>functional programming via user-defined functions (for transformations, 
                aggregations, selections, sorting) 
              <li>comparison 
            </ul>
          </td>
        </tr>
      </table>
      <p>&nbsp;</p>
    </td>
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358" height="55">
        <tr> 
          <td valign="MIDDLE" colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Columnwise Data Analysis</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td width="180" align="LEFT"> 
            <ul>
              <li>covariance, correlation matrix 
              <li>maximum 
              <li>minimum 
              <li>mean 
              <li>variance, standard deviation 
              <li>median 
              <li>exact and approximate quantiles 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li>(cumulative) sum 
              <li>(cumulative) product 
              <li>harmonic, geometric mean 
              <li>skew, kurtosis 
              <li>moments 
              <li>frequencies 
              <li>sorting 
            </ul>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr valign="top" align="left"> 
    <td> 
      <table border="0" cellpadding="0" cellspacing="0" width="358">
        <tr> 
          <td colspan="2" bgcolor="#770000"> 
            <p align="CENTER"><font color="#FFFFFF"><b>Array and Matrix Utilities</b></font> 
          </td>
        </tr>
        <tr valign="top"> 
          <td align="LEFT" width="180"> 
            <ul>
              <li> dense and sparse creation 
              <li>string formatting 
              <li>up-down or left-right concatenation 
              <li>create, extract block matrix 
            </ul>
          </td>
          <td align="LEFT" width="180"> 
            <ul>
              <li>create, extract diagonals 
              <li>extract upper, lower triangular parts 
              <li>random matrix, array 
            </ul>
          </td>
        </tr>
      </table>
    </td>
    <td> 
      <p>&nbsp;</p>
    </td>
  </tr>
</table>
<p>File-based I/O can be achieved through the standard Java-built-in serialization 
  mechanism. All classes implement the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/Serializable.html" title="class or interface in java.io"><CODE>Serializable</CODE></A> interface. 
  However, the toolkit is entirely decoupled from advanced I/O and visualisation 
  techniques. It provides data structures and algorithms only. </p>
<p> This toolkit borrows many fundamental concepts and terminology from the IBM 
  <a href="http://math.nist.gov/javanumerics/array/"> Array</a> package written 
  by Jose Moreira, Marc Snir and Sam Midkiff. They introduced well designed multi-dimensional 
  arrays to the Java world. 
<p><a href="#Overview">Back</a> to Overview
<h2><a name="Introduction"></a>2. Introduction</h2>
<p>Multi-dimensional arrays are arguably <i>the</i> most frequently used abstraction 
  in scientific and technical codes. They support a broad variety of applications 
  in the domain of Physics, Linear Algebra, Computational Fluid Dynamics, Relational 
  Algebra, Statistics, Graphics Rendering and others. For example many physics 
  problems can be mapped to matrix problems: Linear and nonlinear systems of equations, 
  linear differential equations, quantum mechanical eigenvalue problems, Tensors, 
  etc. Physics<i> NTuples</i> are essentially 2-d arrays. In the area of Online 
  Analytic Processing <i>(OLAP</i>) multi-dimensional arrays are called <i>Data 
  Cubes</i>. In this toolkit they are called <i>Matrices</i>, simply because the 
  term <i>Array</i> is already heavily overloaded and <i>Data Cube</i> is somewhat 
  fuzzy to many people.</p>
<h2></h2>
<p>Matrices are basically rectangular grids with each cell in the grid containing 
  a single value. Cells are accessed via zero-based integer indexes. Matrices 
  can be characterized by</p>
<ul>
  <li> <i>Rank</i>: The number of dimensions (axes). Most frequently used are one and 
    two dimensions.</li>
  <li> <i>Shape:</i> Each dimension has a certain number of slots. All slots together 
    make up the shape. For example, a 2-dimensional 10 x 50 matrix has 10 slots 
    along its first dimension, and 50 slots along its second dimension, yielding 
    500 cells.</li>
  <li><i>Value type</i>: The type of value to be stored in each cell. Can be integer, 
    floating point or an arbitrary object.</li>
</ul>
<p>Here is an example of a <tt>8x8x8</tt> matrix and other matrices. 
<p><img src="doc-files/slice.gif" width="644" height="401"> 
<p>As broad as the spectrum of applications using multi-dimensional matrices is 
  the number of operations meaningful on them. Only a smallish subset of those 
  operations are provided in this library. We hope that this will change over 
  time. However, core multi-purpose functionality such as <i>subrange</i>, <i>slice</i>, 
  <i>dice</i>, <i>flip</i>, <i>stride</i>, <i>selection</i> and<i> sort</i> views 
  as well as <i>copying</i> and <i>numerical transformations</i> (*,/,+,-,...) 
  are efficiently provided. The primary motivation for views is ease-of-use. Views 
  allow to express otherwise complex aggregate operations in simple terms. They 
  seek to present a matrix in different ways to a user and/or functions operating 
  on a matrix. Subranging, slicing, dicing, flipping, striding, selecting and 
  sorting are virtual transformations: they merely alter the way we see the <i>same 
  data</i>. They produce <i>views</i>, which are objects that know only about 
  certain regions of the entire matrix. Views all point to the same data, so changes 
  in the view are reflected in the original matrix, all other possibly nested 
  views of the original matrix, and vice-versa. Pete and Jane can look at a flower 
  in many different ways although it remains one single flower. If Pete steps 
  on top of the flower, Jane will certainly note. Which is not the case when copying 
  is applied, since it is a materializing transformation. It means, the connection 
  between the original and the copy is lost. If Pete is stepping on top of a rose 
  and Jane is admiring another one, it won't have any impact on her. Views can 
  arbitrarily be nested. They eliminate the need for explicit region operations. 
  Any operation on a matrix can be used as a region restricted operation by operating 
  on a matrix view instead of the whole matrix. Here are some examples: 
<p>&nbsp; 
<table border="0">
  <tr> 
    <td>Lets construct a dense 3 x 4 matrix</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td> 
      <p><tt>DoubleMatrix2D matrix;<br>
        matrix </tt><tt>= new DenseDoubleMatrix2D(3,4);<br>
        </tt><tt>//matrix </tt><tt>= new SparseDoubleMatrix2D(3,4);</tt><tt> </tt><tt>// 
        has same interface<br>
        </tt><tt>//matrix </tt><tt>= new RCDoubleMatrix2D(3,4);</tt><tt> </tt><tt> 
        // has same interface<br>
        </tt><tt></tt><tt>System.out.println(matrix); </tt></p>
    </td>
    <td nowrap><tt>3 x 4 matrix: <br>
      0 0 0 0 <br>
      0 0 0 0 <br>
      0 0 0 0 </tt></td>
  </tr>
  <tr> 
    <td> We can get rid of the typed distinction between sparse and dense matrices. 
      Use a factory, as follows</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td> 
      <p><tt>DoubleFactory2D factory;<br>
        if (wantDense) factory = DoubleFactory2D.dense;<br>
        else if (wantSparseHashed)&nbsp;factory = DoubleFactory2D.sparse;<br>
        else factory = DoubleFactory2D.rowCompressed;<br>
        <br>
        // From now on all instantiations will go via the factory -<br>
        // No explicit constructor calls anymore</tt><tt><br>
        DoubleMatrix2D matrix = factory.make(3,4);<br>
        System.out.println(matrix);</tt> </p>
      </td>
    <td nowrap><tt>3 x 4 matrix: <br>
      0 0 0 0 <br>
      0 0 0 0 <br>
      0 0 0 0 </tt></td>
  </tr>
  <tr> 
    <td>The shape can be retrieved with <br>
      <tt>int rows = matrix.rows(); <br>
      int columns = matrix.columns();</tt> </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td>We set and get a cell value:</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td> 
      <p><tt>int row = 2, column = 0;<br>
        </tt><tt>matrix.set(row,column, 7);<br>
        System.out.println(matrix.get(row,column));<br>
        // --&gt; 7</tt></p>
    </td>
    <td nowrap><tt>3 x 4 matrix <br>
      0 0 0 0 <br>
      0 0 0 0 <br>
      7 0 0 0 </tt></td>
  </tr>
  <tr> 
    <td>Looping is done as expected:</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td> <tt> 
      <pre>
double sum = 0;
for (int row=rows; --row &gt;= 0; ) {
   for (int column=columns; --column &gt;= 0; ) {
      sum += matrix.get(row,column); // bounds check
      //sum += matrix.getQuick(row,column); // no bounds check
   }
}
System.out.println(sum); 
</pre>
      </tt> </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td>The following idiom uses a subranging view to set all cells of the box 
      <br>
      starting at <tt>[1,0]</tt> with width and height of 2 to the value <tt>1</tt>: 
    </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>matrix.viewPart(1,0,2,2).assign(1);<br>
      System.out.println(matrix); <br>
      </tt></td>
    <td nowrap><tt>3 x 4 matrix <br>
      0 0 0 0 <br>
      1 1 0 0 <br>
      1 1 0 0 </tt></td>
  </tr>
  <tr> 
    <td> 
      <p>A dicing view can be used to print the matrix in a different format (4 
        x 3). This is equivalent to a zero-copy transposition:</p>
    </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>System.out.println(matrix.viewDice())</tt></td>
    <td nowrap><tt>4 x 3 matrix <br>
      0 1 1 <br>
      0 1 1 <br>
      0 0 0 <br>
      0 0 0 </tt></td>
  </tr>
  <tr> 
    <td> 
      <p>Next, a flipping view mirrors the matrix. </p>
    </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>System.out.println(matrix.viewColumnFlip());</tt></td>
    <td nowrap><tt>3 x 4 matrix <br>
      0 0 0 0 <br>
      0 0 1 1 <br>
      0 0 1 1 </tt></td>
  </tr>
  <tr> 
    <td> 
      <p>A slicing view shows the second row, a 1-dimensional matrix:</p>
    </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>System.out.println(matrix.viewRow(1)); </tt></td>
    <td nowrap><tt>4 matrix <br>
      1 1 0 0 </tt></td>
  </tr>
  <tr> 
    <td> 
      <p>Note that the result of a slicing operation is not a 2-d matrix with 
        one row, but a true 1-d <b>type</b> with all capabilities of the type, 
        namely <A HREF="../../../cern/colt/matrix/DoubleMatrix1D.html" title="class in cern.colt.matrix"><CODE>DoubleMatrix1D</CODE></A>, generated in constant 
        time.</p>
      <p>The slicing view is now fed into some external algorithm expecting a 
        1-dimensional matrix:<br>
        <tt>someAlgorithm(matrix.viewRow(1));</tt> </p>
    </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td>If the algorithm is designed such that it modifies data of the row, <br>
      but we want to avoid any side-effects, we can feed it a copy of the row: 
      <tt><br>
      someAlgorithm(matrix.viewRow(1).copy());</tt> </td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td>A stride view shows every row and every second column. It is useful for 
      scatter/gather operations.</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>System.out.println(matrix.viewStrides(1,2)); </tt></td>
    <td nowrap><tt>3 x 2 matrix <br>
      0 0<br>
      1 0<br>
      1 0</tt></td>
  </tr>
  <tr> 
    <td>A selection view shows explicitly specified rows and columns. Imagine 
      a 2-d matrix. Columns are attributes <i>energy</i>, <i>tracks</i>, <i>momentum</i>, 
      the rows hold <tt>N</tt> such measurements, as recorded by some device. 
      We want to operate on some subset of the columns and exclude some measurements 
      not of interest for our analysis.</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>int[] rowIndexes = {0,2};<br>
      int[] columnIndexes = {2,3,1,1};<br>
      System.out.println(matrix.viewSelection(rowIndexes,columnIndexes)); </tt></td>
    <td nowrap><tt>2 x 4 matrix <br>
      0 0 0 0 <br>
      0 0 1 1 </tt></td>
  </tr>
  <tr> 
    <td>A sort view with row flipping shows rows sorted descending by column 1:</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>System.out.println(matrix.viewSorted(1).viewRowFlip()); </tt></td>
    <td nowrap><tt>3 x 4 matrix <br>
      1 1 0 0 <br>
      1 1 0 0 <br>
      0 0 0 0 </tt></td>
  </tr>
  <tr> 
    <td>Last, lets combine some of the methods to stimulate imagination:</td>
    <td nowrap>&nbsp;</td>
  </tr>
  <tr> 
    <td><tt>matrix.viewPart(0,1,2,2).viewRowFlip().viewColumn(0).assign(2);<br>
      System.out.println(matrix); <br>
      </tt></td>
    <td nowrap><tt>3 x 4 matrix <br>
      0 2 0 0 <br>
      1 2 0 0 <br>
      1 1 0 0 </tt></td>
  </tr>
</table>
<p><a href="#Overview">Back</a> to Overview 
<h2></h2>
<h2><a name="SemanticsOfViews"></a>3. Semantics of Views </h2>
<p>Find out more about the <a href="doc-files/semanticsOfViews.html">precise semantics</a> 
  of views and basic operations.</p>
<p><a href="#Overview">Back</a> to Overview
<h2></h2>
<h2><a name="Orthogonality"></a>4. Orthogonality and Polymorphism</h2>
<p>If this section sounds trivial and obvious, you can safely skip it.<br>
  The desire for orthogonality is a desire for &quot;plug and play&quot;. Orthogonality 
  demands that everything can be plugged together with everything, or, in other 
  words, that different things can be handled in the same way. Of course only 
  things that syntactically and semantically share a common set of interfaces 
  can be handled in the same way, or work together in the same way. Polymorphism 
  is an implementation mechanism supporting orthogonality. It is about being able 
  to exchange things without noticing any difference. Again, as long as the things 
  adhere to some common interface.</p>
<p>The common interface for matrices is defined in abstract base classes (e.g. 
  <A HREF="../../../cern/colt/matrix/DoubleMatrix2D.html" title="class in cern.colt.matrix"><CODE>DoubleMatrix2D</CODE></A>). Note that looking at the documentation 
  of some concrete instantiable class (e.g. <A HREF="../../../cern/colt/matrix/impl/DenseDoubleMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>DenseDoubleMatrix2D</CODE></A>, 
  <A HREF="../../../cern/colt/matrix/impl/SparseDoubleMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>SparseDoubleMatrix2D</CODE></A>, <A HREF="../../../cern/colt/matrix/impl/RCDoubleMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>RCDoubleMatrix2D</CODE></A><img src="../doc-files/new.gif" width="32" height="22" align="top">) 
  will not reveal more information than can be obtained by looking at the abstract 
  base classes. The convention is that concrete classes <i>do no subsetting or 
  supersetting</i>. They override methods to implement behaviour dictated by abstract 
  classes, or to improve performance, but they do not introduce any new functionality. 
</p>
<p>Although each matrix of a given rank and value type comes with dense and sparse 
  implementations and a multitude of views, there is from the user interface perspective 
  no difference between them. All implementations have exactly the same interface 
  with exactly the same semantics attached. In particular, everything that &quot;can 
  be done&quot; with a dense matrix can also be done with a sparse specie, and 
  vice-versa. The same principle applies to views. </p>
<p><i>This implies that any internal or external function expecting as argument 
  an abstract matrix (and any operation defined on an abstract matrix) can be 
  used with any kind of matrix of the given rank and value type, whether it be 
  dense, sparse, sub-ranged, selected, strided, sorted, flipped, transposed, or 
  any arbitrary combination thereof. For example, dense matrices can be multiplied/assigned/transformed/compared 
  with sparse matrices, dense stride views with dense flip views, dense sorted 
  flipped sub-range views with sparse selection views, in all conceivable permutations. 
  The result is a powerful and flexible tool.</i></p>
<h2></h2>
<p><a href="#Overview">Back</a> to Overview 
<h2><a name="FunctionObjects"></a>5. Function Objects</h2>
<p>Function objects conveniently allow to express arbitrary functions in a generic 
  manner. Essentially, a function object is an object that can perform a function 
  on some arguments. It has a minimal interface: a method <tt>apply</tt> that 
  takes the arguments, computes something and returns some result value. Function 
  objects are comparable to function pointers in C used for call-backs. Here are 
  some examples demonstrating how function objects can be used to </p>
<ol>
  <li> <a href="doc-files/function1.html">transform</a> a matrix A into another 
    matrix B which is a function of the original matrix A (and optionally yet 
    another matrix C)</li>
  <li> <a href="doc-files/function2.html">aggregate</a> cell values or a function 
    of them</li>
  <li> <a href="doc-files/function3.html">generate selection views</a> for cells 
    satisfying a given condition</li>
  <li> <a href="doc-files/function4.html">sort</a> matrix rows or columns into 
    a user specified order</li>
  <li>You will most likely use them to do many more powerful things </li>
</ol>
<p>Usually, assign operations are heavily optimized for frequently used function 
  objects like plus, minus, mult, div, plusMult, minusMult, etc. Concerning the 
  performance of unoptimized function objects, see <A HREF="../../../cern/jet/math/Functions.html" title="class in cern.jet.math"><CODE>Functions</CODE></A>.</p>
<p></p>
<p><a href="#Overview">Back</a> to Overview
<h2></h2>
<h2><a name="Algorithms"></a>6. Algorithms </h2>
<p>As already stated, the spectrum of applications using multi-dimensional matrices 
  is large and so is the number of operations meaningful on them. One single flat 
  interface cannot satisfy all needs and would soon get unmanageably fat. To avoid 
  interface bloat, it can be a good idea to separate algorithms from data structures. 
  Special purpose algorithms, wrappers, mediators etc. should therefore go into 
  external packages and classes. By using the common interfaces defined in abstract 
  classes, algorithms can be implemented such that they generically work both 
  on sparse and dense matrices and all their views. This will ensure scalability 
  over time, as more and more features are added. </p>
<p>Some algorithms for formatting, sorting, statistics and partitioning, are, 
  for example, provided in the package <A HREF="../../../cern/colt/matrix/doublealgo/package-summary.html"><CODE>cern.colt.matrix.doublealgo</CODE></A>. </p>
<p><a href="#Overview">Back</a> to Overview</p>
<h2></h2>
<h2><a name="LinearAlgebra"></a>7. Linear Algebra</h2>
<p>See the documentation of the linear algebra package <A HREF="../../../cern/colt/matrix/linalg/package-summary.html"><CODE>cern.colt.matrix.linalg</CODE></A>.</p>
<p><a href="#Overview">Back</a> to Overview </p>
<h2><a name="PackageOrganization"></a>8. Package Organization, Naming Conventions, 
  Policies</h2>
<h4>Class Naming / Inheritance</h4>
<p>Have a look at the javadoc <a href="package-tree.html">tree view</a> to get 
  the broad picture. The classes for matrices of a given rank are derived from 
  a common abstract base class named <tt>&lt;ValueType&gt;Matrix&lt;Rank&gt;D</tt>, 
  which is in many ways equivalent to an &quot;interface&quot;. <b>99% of the 
  time you will operate on these abstract classes only</b>. For example, all 2-dimensional 
  matrices operating on <tt>double</tt> values are derived from <A HREF="../../../cern/colt/matrix/DoubleMatrix2D.html" title="class in cern.colt.matrix"><CODE>DoubleMatrix2D</CODE></A>. 
  This is the interface to operate on.</p>
<p>Class naming for concrete instantiable classes follows the schema <tt>&lt;Property&gt;&lt;ValueType&gt;Matrix&lt;Rank&gt;D</tt>. 
  For example, we have a <A HREF="../../../cern/colt/matrix/impl/DenseDoubleMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>DenseDoubleMatrix2D</CODE></A>, a 
  <A HREF="../../../cern/colt/matrix/impl/SparseDoubleMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>SparseDoubleMatrix2D</CODE></A>, a <CODE>cern.colt.matrix.impl.DenseIntMatrix3D</CODE>, 
  and so on. All concrete instantiable classes are separated into an extra package, 
  <A HREF="../../../cern/colt/matrix/impl/package-summary.html"><CODE>cern.colt.matrix.impl</CODE></A>, to clearly distinguish between interfaces and 
  implementations.</p>
<p><A HREF="../../../cern/colt/matrix/DoubleMatrix2D.html" title="class in cern.colt.matrix"><CODE>DoubleMatrix2D</CODE></A> in turn is derived from an abstract 
  base class tying together all 2-dimensional matrices regardless of value type, 
  <A HREF="../../../cern/colt/matrix/impl/AbstractMatrix2D.html" title="class in cern.colt.matrix.impl"><CODE>AbstractMatrix2D</CODE></A>, which finally is rooted in grandmother 
  <A HREF="../../../cern/colt/matrix/impl/AbstractMatrix.html" title="class in cern.colt.matrix.impl"><CODE>AbstractMatrix</CODE></A>.</p>
<p>The abstract base classes provide skeleton implementations for all but few 
  methods. Experimental data layouts can easily be implemented and inherit a rich 
  set of functionality. For example, to implement a fully functional 2-d or 3-d 
  matrix, only 6 abstract methods need to be overridden: <tt>getQuick, setQuick, 
  like, like1D, viewSelectionLike</tt>.</p>
<h4>Method Naming</h4>
<p>In order to improve browsing and better keep an overview, the namespace of 
  logically related operations is localized: Methods getting and setting individual 
  cell values are named <tt>get</tt> and <tt>set</tt>. Methods constructing views 
  are named <tt>viewXXX</tt> (e.g. <tt>viewPart</tt>). Copying/assignment methods 
  are named <tt>copy</tt> and <tt>assignXXX</tt>. Mathematical operations are 
  named <tt>zXXX</tt> (e.g. <tt>zMult</tt>). Generic aggregation operations are 
  named <tt>aggregateXXX</tt>.</p>
<h4>Convenience Methods</h4>
<p>To keep interfaces lean and manageable, we tried to avoid littering them with 
  convenience methods obfuscating more fundamental concepts. Convenience operations 
  expressible in one to three lines of code are omitted. For example, all operations 
  modifying cell values modify the receiver (<tt>this</tt>) itself. There are 
  no methods to fill results into empty result matrices. Use idioms like <tt>result 
  = matrix.copy().mult(5)</tt> to achieve the same functionality. Some convenience 
  methods are provided in the factory classes as well as in external packages 
  like <A HREF="../../../cern/colt/matrix/doublealgo/package-summary.html"><CODE>cern.colt.matrix.doublealgo</CODE></A>.</p>
<p><a href="#Overview">Back</a> to Overview 
<h2><a name="Performance"></a>9. Performance</h2>
<p>The following statements apply to all currently implemented features (i.e. 
  dense and sparse matrices including all view kinds), except where indicated.</p>
<p> Constant factors are kept as small as possible.Views are constructed in guaranteed 
  <tt>O(1)</tt>, i.e. constant time, except for selection views and sort views: 
  Selection views take time linear in the number of indexes, sort views take <tt>O(N*logN)</tt> 
  on average. Getting/setting a cell value takes <i>guaranteed </i>constant time 
  for <font color="#CC0000">dense</font> matrices (and all their views), while 
  it takes <i>expected</i> constant time for sparse hash matrices (and all their 
  views). More specifically, on <font color="#CC0000">sparse hash</font> matrices, 
  these operations can, although highly improbable, degenerate to time linear 
  in the number of non-zero cells. This is because of the nature of hashing: Average 
  case behaviour is extremely good, worst case behaviour is bad. </p>
<p><font color="#CE0000">Sparse row compressed</font> matrices have the following 
  characteristics: Getting a cell value takes time<tt> O(log nzr)</tt> where <tt>nzr</tt> 
  is the number of non-zeros of the touched row. This is usually quick, because 
  typically there are only few nonzeros per row. So, in practice, get has <i>expected</i> 
  constant time. Setting a cell value takes <i> </i>worst-case time <tt>O(nz)</tt> 
  where <tt>nzr</tt> is the total number of non-zeros in the matrix. This can 
  be extremely slow, but if you traverse coordinates properly, each write is done 
  much quicker. For how to do this and other tips, see the <a href="doc-files/performanceNotes.html">performance 
  notes</a>. <img src="../doc-files/new.gif" width="32" height="22" align="middle"> 
</p>
<p></p>
<p>Some preliminary benchmarks can be found in the <a href="doc-files/PerformanceLogFrame.html">performance 
  log</a>.</p>
<p>All matrices use strided 32-bit integer arithmetic for linear cell addressing, 
  similar to Fortran. The chosen cell addressing implementation is the key feature 
  enabling the easy implementation and good performance of advanced views.</p>
<p>All methods are bounds checking, except for trusting variants of <tt>get</tt> 
  and <tt>set</tt> called <tt>getQuick</tt> and <tt>setQuick</tt> which should 
  and are used in expensive (often cubic) loops where it is dramatically cheaper 
  to check bounds before entering the loop, not in the loop. Fundamentally time 
  critical methods of dense matrices override default implementations such that 
  iteration eliminates function calls, minimizes cell addressing overhead and 
  gets pipelined. Some operations use processor cache oriented optimization techniques 
  such as memory layout aware iteration, blocking of slow changing operands followed 
  by logical optimizations such as sparsity detection.</p>
<p>In order to eliminate expensive call chains, views directly point to the data 
  without indirection, no matter how deeply nested they are. In particular they 
  are not implemented with delegation. In fact they are not nested at all, even 
  if they logically appear like that. There is largely no distinction between 
  views and non-views. Note that this is not true for row-compressed matrices; 
  their views are wrappers and do use delegation (aka call chains). <img src="../doc-files/new.gif" width="32" height="22" align="top"></p>
<p>Although view objects occupy only a couple of bytes, generating temporary views 
  at very high frequency can lead to heavy garbage collection. </p>
<p>To keep the overhead minimal, copying operations are highly optimized. They 
  sometimes boil down to <tt>System.arraycopy</tt> (which is nothing else than 
  a byte-aligned C <tt>memmove</tt>). Also note that memory access patterns (cache 
  locality) of self-modifying matrix operations are better than for result matrix 
  modifying operations.</p>
<p><a href="#Overview">Back</a> to Overview 
<h2></h2>
<h2><a name="Notes"></a>10. Notes </h2>
<h2></h2>
<p>Matrices are not dynamically resizable; it is impossible to physically insert 
  or remove cells. Some logical cell removal and insertion can be achieved by 
  means of views. To achieve physical cell removal or insertion, a new matrix 
  with the needed shape must be constructed and cells copied. Note, however, that 
  there are convenience methods to do many kind of resizing operations.</p>
<p>Another current limitation is the inability to address more than 2<sup>31</sup> 
  cells. This can be a problem for very large sparse matrices. 64-bit addressing 
  is possible, but unlikely to be implemented unless there is serious demand.</p>
<p><a href="#Overview">Back</a> to Overview</p>
<P>

<P>
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Colt 1.2.0</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../cern/colt/map/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../cern/colt/matrix/bench/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=-1 >Jump to the <a target=_top href=http://dsd.lbl.gov/~hoschek/colt >Colt Homepage</a>
</BODY>
</HTML>