]> www.ginac.de Git - cln.git/blob - src/vector/output/cl_SV_aprint.cc
cl_{GV,SV}: use std::size_t for size of vectors (instead of obscure uintC).
[cln.git] / src / vector / output / cl_SV_aprint.cc
1 // fprint() for cl_SV_ringelt.
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/SV_ringelt.h"
8
9
10 // Implementation.
11
12 #include "cln/output.h"
13
14 namespace cln {
15
16 void fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& vector)
17 {
18         const cl_print_flags& flags = default_print_flags;
19         std::size_t len = vector.size();
20         if (flags.vector_syntax == vsyntax_commonlisp) {
21                 fprintchar(stream,'#');
22                 fprintchar(stream,'(');
23         } else
24                 fprintchar(stream,'[');
25         for (std::size_t i = 0; i < len; i++) {
26                 if (i > 0) {
27                         if (flags.vector_syntax == vsyntax_algebraic)
28                                 fprintchar(stream,',');
29                         fprintchar(stream,' ');
30                 }
31                 R->_fprint(stream,vector[i]);
32         }
33         if (flags.vector_syntax == vsyntax_commonlisp)
34                 fprintchar(stream,')');
35         else
36                 fprintchar(stream,']');
37 }
38
39 }  // namespace cln