atlas  0.6
interactive.h
Go to the documentation of this file.
1 /*
2  This is interactive.h
3 
4  Copyright (C) 2004,2005 Fokko du Cloux
5  Copyright (C) 2006--2011 Marc van Leeuwen
6  part of the Atlas of Lie Groups and Representations
7 
8  For license information see the LICENSE file
9 */
10 
11 #ifndef INTERACTIVE_H /* guard against multiple inclusions */
12 #define INTERACTIVE_H
13 
14 #include "../Atlas.h"
15 
16 #include <string>
17 #include <ios>
18 
19 #include "error.h"
20 #include "tags.h"
21 
22 namespace atlas {
23 
24 /******** type declarations **************************************************/
25 
26 /* the strange namespace is an historic artifact; the class was moved */
27 
28 namespace ioutils {
29 
30  class OutputFile;
31 
32 }
33 
34 /******** function declarations **********************************************/
35 
36 namespace interactive {
37 
38  std::string getFileName(const std::string& prompt)
39  throw(error::InputError);
40 
41  bool open_binary_file(std::ofstream& block_out,const std::string& prompt);
42 
43  void bitMapPrompt(std::string&, const char*, const BitMap&);
44 
45  size_t get_Cartan_class(const BitMap& cs) throw(error::InputError);
46 
47  void get_group_type(InnerClass*&, output::Interface*&)
48  throw(error::InputError);
49 
50  void getInteractive(LieType&) throw(error::InputError);
51 
52  void getInteractive(PreRootDatum&,
53  WeightList&,
54  const LieType&) throw(error::InputError);
56  getInnerClass(lietype::Layout& lo, const WeightList& basis)
57  throw(error::InputError);
58  void getInteractive(InnerClassType&, const LieType&)
59  throw(error::InputError);
60 
61  RealFormNbr get_real_form(output::Interface&)
62  throw(error::InputError);
63 
65  const InnerClass& G,
66  RealFormNbr rf)
67  throw(error::InputError);
68 
69 
70  unsigned long get_bounded_int(input::InputBuffer& ib,
71  const char* prompt,
72  unsigned long limit)
73  throw(error::InputError);
74 
75  unsigned long get_int_in_set(const char* prompt,
76  const BitMap& choices,
77  input::InputBuffer* linep = 0)
78  throw(error::InputError);
79 
80  Weight get_weight(input::InputBuffer& ib,
81  const char* prompt,
82  size_t rank)
83  throw(error::InputError);
84 
85  RatWeight get_ratweight(input::InputBuffer& ib,
86  const char* prompt,
87  size_t rank)
88  throw(error::InputError);
89 
90  standardrepk::StandardRepK get_standardrep
91  (const standardrepk::SRK_context& c)
92  throw(error::InputError);
93 
94  StandardRepr get_repr(const Rep_context& c)
95  throw(error::InputError);
96 
97  input::InputBuffer& common_input();
98  input::InputBuffer& sr_input();
99 
100  SubSystemWithGroup get_parameter(RealReductiveGroup& GR,
101  KGBElt& x,
102  Weight& lambda_rho,
103  RatWeight& gamma)
104  throw(error::InputError);
105 
106  void getInteractive(atlas::Parabolic &psg, size_t rank)
107  throw(error::InputError);
108 
109 }
110 
111 /******** type definitions ***************************************************/
112 
113 namespace ioutils {
114 
115 // the next class emulates an (impossible) derivation from std::ostream&
117 {
118  std::ostream* d_stream;
119  bool d_foutput;
120  public:
121  OutputFile() throw(error::InputError);
122  ~OutputFile();
123  template<typename T> std::ostream& operator<< (const T& arg)
124  {return *d_stream << arg;}
125  operator std::ostream& () {return *d_stream;}
126  bool is_std_cout () const { return not d_foutput; }
127 }; // |class OutputFile|
128 
129 
130 class InputFile {
131  private:
132  std::ifstream* d_stream;
133  public:
134  InputFile(std::string prompt,
135  std::ios_base::openmode mode
136  =std::ios_base::in | std::ios_base::binary)
137  throw(error::InputError);
138  ~InputFile();
139  operator std::ifstream& () {return *d_stream;}
140 };
141 
142 }
143 
144 }
145 
146 #endif
Definition: ctangle.c:136
input::InputBuffer & common_input()
Definition: interactive.cpp:948
Definition: interactive.h:130
RatWeight get_ratweight(input::InputBuffer &ib, const char *prompt, size_t rank)
Definition: interactive.cpp:736
mode
Definition: cweave.c:359
RealFormNbr get_real_form(output::Interface &CI)
Definition: interactive.cpp:456
SubSystemWithGroup get_parameter(RealReductiveGroup &GR, KGBElt &x, Weight &lambda_rho, RatWeight &gamma)
Definition: interactive.cpp:779
char * limit
Definition: common.c:91
unsigned long get_bounded_int(input::InputBuffer &ib, const char *prompt, unsigned long limit)
Definition: interactive.cpp:617
WeightInvolution getInnerClass(lietype::Layout &lo, const WeightList &basis)
Definition: interactive.cpp:392
std::ifstream * d_stream
Definition: interactive.h:132
void get_group_type(InnerClass *&pG, output::Interface *&pI)
Definition: interactive.cpp:240
int_Vector Weight
Definition: Atlas.h:154
input::InputBuffer & sr_input()
Definition: interactive.cpp:954
RealFormNbr get_dual_real_form(output::Interface &CI, const InnerClass &G, RealFormNbr rf)
Definition: interactive.cpp:500
std::vector< Weight > WeightList
Definition: Atlas.h:162
standardrepk::StandardRepK get_standardrep(const standardrepk::SRK_context &c)
bool is_std_cout() const
Definition: interactive.h:126
void output(text_pointer)
Definition: ctangle.c:342
unsigned int KGBElt
Definition: Atlas.h:339
size_t get_Cartan_class(const BitMap &cs)
Definition: interactive.cpp:208
Definition: interactive.h:116
bool d_foutput
Definition: interactive.h:119
unsigned short RealFormNbr
Definition: Atlas.h:302
unsigned long get_int_in_set(const char *prompt, const BitMap &vals, input::InputBuffer *linep)
Definition: interactive.cpp:660
std::ostream * d_stream
Definition: interactive.h:118
int_Matrix WeightInvolution
Definition: Atlas.h:159
std::string getFileName(std::string prompt)
Definition: polstat.cpp:320
Definition: Atlas.h:38
Definition of dummy argument tags used for constructor overloading.
RankFlags Parabolic
Definition: Atlas.h:348
void getInteractive(LieType &d_lt)
Definition: interactive.cpp:285
void basis(std::vector< matrix::Vector< int > > &b, const bitmap::BitMap &B, const FiniteAbelianGroup &A)
Definition: abelian.cpp:427
bool open_binary_file(std::ofstream &block_out, const std::string &prompt)
Definition: interactive.cpp:163
Definition: cweave.c:262
void bitMapPrompt(std::string &prompt, const char *mess, const BitMap &vals)
Definition: interactive.cpp:186
Weight get_weight(input::InputBuffer &ib, const char *prompt, size_t rank)
Definition: interactive.cpp:715
ratvec::RationalVector< arithmetic::Numer_t > RatWeight
Definition: Atlas.h:156
StandardRepr get_repr(const Rep_context &c)
Definition: interactive.cpp:764