search for: cout

Displaying 20 results from an estimated 578 matches for "cout".

Did you mean: count
2007 May 31
1
Problems when linking to R shared library
...o the R shared library. I've tried this on both Windows with the precompiled Mingw binary of R-2.5.0 (compiling my code with MinGW-3.4.2), and by building R-2.5.0 on Mandriva Linux with gcc-3.4.4 and --enable-R-shlib. The actual code is at the end of the message, but the main cases are: std::cout << pf(1.5, 2.0, 3.0, 1, 0) << std::endl; Outputs 1, expect 0.646447 std::cout << pchisq(1.5, 2.0, 1, 0) << std::endl; Outputs 1, expect 0.527633 std::cout << pgamma(1.5, 2.0, 3.0, 1, 0) << std::endl; Outputs 1, expect 0.090204 std::cout << ppois(2.0,...
2018 Dec 09
2
Parse LLVM IR
...#include <llvm/Support/SourceMgr.h> #include <iostream> #include <llvm/Support/raw_ostream.h> using namespace llvm; int main() { LLVMContext context; SMDiagnostic error; Module *m = parseIRFile("t.ll", error, context).get(); if(!m) { return 0; } std::cout << error.getMessage().str() << std::endl; std::cout << sizeof(m->getFunctionList()) << std::endl; auto iter1 = m->getFunctionList().begin(); std::cout << " Function: " << (*iter1).getName().str() << std::endl; for (auto iter1 = m-&g...
2006 May 23
0
[LLVMdev] Binary output to cout on Windows
...r<<"Cannot set input mode to binary."<<std::endl; return 1; > } > result = _setmode( _fileno(stdout), _O_BINARY ); > if( result == -1 ) > { std::cerr<<"Cannot set output mode to binary."<<std::endl; return 1; > } > before using cin or cout. I'm not sure where to add this however, since > it needs to be called before any reads or writes are done, but only > needs to be called once. Any suggestions? At the moment in my own code, > I'm adding them to the tools source files, since that's where it's > determine...
2006 May 23
3
[LLVMdev] Binary output to cout on Windows
...result == -1 ) { std::cerr<<"Cannot set input mode to binary."<<std::endl; return 1; } result = _setmode( _fileno(stdout), _O_BINARY ); if( result == -1 ) { std::cerr<<"Cannot set output mode to binary."<<std::endl; return 1; } before using cin or cout. I'm not sure where to add this however, since it needs to be called before any reads or writes are done, but only needs to be called once. Any suggestions? At the moment in my own code, I'm adding them to the tools source files, since that's where it's determined that cin/cout can...
2005 Oct 17
6
Error Executing sampledec in VC++
...lt options for decoding: temp = 1; speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp); // Initialize spxbits (structure SpeexBits) speex_bits_init (&spxbits); while (!(feof(fo))) // this is where the problem starts { fread (&nbBytes, sizeof(int), 1, fo); fread (cbits, 1, nbBytes, fo); cout << "1"; // just to see whether the loop iterates speex_bits_read_from (&spxbits, cbits, nbBytes); speex_decode (decstate, &spxbits, pcm); // Copy 1 frame from float pcm to short spx for (n=0; n<FRAME_SIZE; n++) spx [n] = pcm [n]; fwrite (spx, sizeof(short), FRAME_SIZE...
2005 Oct 17
3
Error Executing sampledec in VC++
...h> #include <iostream.h> void main () { // Definitions #define FRAME_SIZE 160 #define FIXED_POINT // Variable Declarations FILE *fo, *fs; short spx [FRAME_SIZE]; float pcm [FRAME_SIZE]; char cbits [200]; int nbBytes, n, temp; void *decstate; SpeexBits spxbits; // Program starts here: cout << "Starting spxdec...\n"; fo = fopen("samp.spx","rb"); if (fo == NULL) cout << "Error!\n"; else cout << "Okay!\n"; fs = fopen ("pcmfile", "wb"); if (fs == NULL) cout << "Error creating file!\n&quo...
2006 May 22
1
[LLVMdev] Binary output to cout on Windows
Hi Reid, llvm-as interprets "-" as using standard output (cout), so llvm-as < input.ll -o - | opt has the same behavior. You'll actually find a comment on it in llvm-as.cpp, so I guess I shouldn't hold out hope that there's a good way to do it. Michael -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at c...
2011 May 06
1
cerr and cout not working calling c++ from R
...different in performance between calling the same function from main in c++ vs. calling the same function from R. I?m not getting any signs of errors from R, but the behavior is different somehow and in a way that breaks my algorithms. In both cases of launching a function from c++ or R, I redirect cout to a file using a streambuf. In particular, I can see progress stop when launching from R at a point when cout gets truncated when starting to write out iterator values in a std::vector<string>. Then, I find no way to write anything else to cout. When I write those values to Rprintf, they are...
2009 May 12
1
[LLVMdev] Tutorial 1: casting cout
To get Tutorial 1 to compile, I had to cast cout as a raw_osstream, as in: PM.add(createPrintModulePass(&llvm::cout)); ----> PM.add(createPrintModulePass((raw_ostream*)&llvm::cout)); I was getting the following error: $ c++ -g tut1.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut1 tut1.cpp: In function ‘int main(int, cha...
2014 Apr 13
2
Adding an external library to Xapian
...rn.h" +// TODO remove later +#include <iostream> +#include <fstream> + #include <cstdlib> // For abs(). #include <cstring> @@ -94,6 +98,18 @@ LOGCALL_DTOR(API, "Database"); } +// LOG Function +void +Database::log(const std::string &query) { + cout << "In Database::log" << endl; + // For now usind DB's UUID to record logs + string logname = "../logs/" + this->get_uuid(); + cout << "Log file: " << logname << "Query " << query << endl; + std::ofstream logf...
2006 Aug 25
0
Session request packet
...Host, int iPort); int sendNBT(void* data, size_t count, int socketid); bool getnetbiosname(char* netbiosname, const char* hostname, unsigned char type); //Main function int main(int argc, char *argv[]) { int socketid = 0; if((socketid = connectHost("192.168.2.65", 139)) == -1) cout << "Connect host error" << endl; NBT_Request request; request.NBTSessionHeader.type = 0x81; request.NBTSessionHeader.flags = 0x0; request.NBTSessionHeader.length = htons(0x40); getnetbiosname(request.called.name, "0", 0x20); getnetbiosname(request...
2014 Apr 13
2
Adding an external library to Xapian
My code is not on Github. I am using the tarball as of now. The following it the error that occurred: http://pastebin.com/cVJrjUZX On Sun, Apr 13, 2014 at 8:16 PM, James Aylett <james-xapian at tartarus.org>wrote: > On 13 Apr 2014, at 15:37, Pallavi Gudipati <pallavigudipati at gmail.com> > wrote: > > > A linker error is encountered even after following the above
2006 May 22
1
[LLVMdev] Binary output to cout on Windows
I'm trying to resolve an issue that occurs in the native Windows implementation of LLVM (it probably doesn't occur in Cygwin, but I haven't checked). Namely, when calling llvm-as < input.ll > output.bc OR llvm-as < input.ll | opt outputting to cout is adding \r (the CR character) to newlines. This specifically causes problems in WriterContext::write(...) in lib/Support/Compressor.cpp. Is anyone aware of a way to use a binary mode on cout in Windows (compiled with Visual Studio .NET 2003), or at least disable the inclusion of \r? It would be n...
2013 Jan 26
1
[LLVMdev] MCJIT/interpreter and iostream
...engines? I'm getting some errors... Each of these commands correctly prints "hello": echo -e '#include <stdio.h>\nint main(){ printf("hello"); }' | clang -cc1 -emit-llvm-bc -x c++ | lli -use-mcjit echo -e '#include <iostream>\nint main(){ std::cout << "hello" << std::endl; }' | clang -cc1 -emit-llvm-bc -x c++ | lli Each of these commands results in "LLVM ERROR: Could not resolve external global address: __dso_handle": echo -e '#include <iostream>\nint main(){ std::cout << "hello&qu...
2007 Sep 28
0
[LLVMdev] Lowering operations to 8-bit!
On Sep 28, 2007, at 11:36 AM, <Alireza.Moshtaghi at microchip.com> <Alireza.Moshtaghi at microchip.com> wrote: > I moved my code to 2.1 but still the same. > If I make ADD i16 legal, then it goes through, but it has problem > expanding it to i8. > Should I go ahead and customize it and do the same for all > instructions? > Or there is a more general thing that I
2015 Jul 26
1
Get term from document by position
...ose(); //searching Xapian::Database db(database_dir); Xapian::Enquire enquire(db); Xapian::QueryParser qp; qp.set_stemmer(stemmer); qp.set_database(db); qp.set_default_op(Xapian::Query::OP_NEAR); qp.set_stemming_strategy(Xapian::QueryParser::STEM_ALL_Z); std::cout << "\n###################################################\n"; std::cout << "query string: " << query_string << "\n"; std::cout << "\n###################################################\n"; Xapian::Query query = qp.par...
2008 Feb 09
2
[LLVMdev] exception handling broken on x86-64?
Hi, when building the second release candidate of llvm 2.2 I noticed that exception handling seems to be broken on Linux x86-64. The exception is thrown but never caught. This can be seen by this trivial example: #include <iostream> using namespace std; class A { }; int main() { cout << "A" << endl; try { cout << "B" << endl; throw A(); cout << "C" << endl; } catch (const A&) { cout << "D" << endl; } cout << "E" << endl; } Wh...
2006 May 23
1
[LLVMdev] Binary output to cout on Windows
...entiate between text and binary on stdin/stdout. ~Michael -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Reid Spencer Sent: Tuesday, May 23, 2006 11:25 AM To: LLVM Developers Mailing List Subject: RE: [LLVMdev] Binary output to cout on Windows Hi Michael, The approach to setting binary mode varies from platform to platform. Thanks for providing the Win32 version. We will also need to work up a Unix version (with variants). The correct way to do this is to add a function to include/llvm/System/Program.h and then implement th...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...e) { InitializeNativeTarget(); InitializeNativeTargetAsmPrinter(); llvm::StringRef sr (skeletons[idx].jit_bytecode, skeletons[idx].jit_bytecode_length); if (sr.str()[0] == 'B') std::cout << "B ok\n"; if (sr.str()[1] == 'C') std::cout << "C ok\n"; if (sr.str()[2] == (char) 0xc0) std::cout << &quo...
2014 Mar 13
2
[LLVMdev] load bytecode from string for jiting problem
...bal variable with StringRef sr (gv, gv_length); 2) I manually test this bytecode by (inspired by inline bool isRawBitcode(const unsigned char *BufPtr, const unsigned char *BufEnd) at http://llvm.org/docs/doxygen/html/ReaderWriter_8h_source.html#l00067) if (sr.str()[0] == 'B') std::cout << "B ok\n"; if (sr.str()[1] == 'C') std::cout << "C ok\n"; if (sr.str()[2] == (char) 0xc0) std::cout << "0xc0 ok\n"; if (sr.str()[3] == (char) 0xde) std::cout << "0xde ok\n"; 3) I try to parse the gv by Me...