OS basic concept

本文介绍了计算机中的进程概念及其如何通过多个线程并发执行来实现多任务处理。此外还解释了程序计数器(PC)的作用及它如何指示计算机程序的执行顺序。

In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

A computer program is a passive collection of instructions; a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed.

Multitasking is a method to allow multiple processes to share processors (CPUs) and other system resources. Each CPU executes a single task at a time. However, multitasking allows each processor to switch between tasks that are being executed without having to wait for each task to finish. Depending on the operating system implementation, switches could be performed when tasks perform input/output operations, when a task indicates that it can be switched, or on hardware interrupts.

 

The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, is a processor register that indicates where a computer is in its program sequence.

In most processors, the PC is incremented after fetching an instruction, and holds the memory address of (“points to”) the next instruction that would be executed. (In a processor where the incrementation precedes the fetch, the PC points to the current instruction being executed.)

 

 

 

http://www.yeolar.com/note/2012/03/22/linux-ecf/

a.cpp: In constructor ‘BigInt::BigInt(std::string)’: a.cpp:9:31: error: expected ‘{’ at end of input 9 | BigInt(string s):number(s);//构造函数 | ^ a.cpp: In function ‘std::istream operator>>(std::istream, BigInt)’: a.cpp:14:16: error: ‘std::basic_istream<_CharT, _Traits>::basic_istream(std::basic_istream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ is protected within this context 14 | return in; | ^~ In file included from /usr/include/c++/11/iostream:40, from a.cpp:1: /usr/include/c++/11/istream:613:7: note: declared protected here 613 | basic_istream(basic_istream&& __rhs) | ^~~~~~~~~~~~~ a.cpp: In function ‘std::ostream operator>>(std::ostream, BigInt)’: a.cpp:19:16: error: ‘std::basic_ostream<_CharT, _Traits>::basic_ostream(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ is protected within this context 19 | return out; | ^~~ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:406:7: note: declared protected here 406 | basic_ostream(basic_ostream&& __rhs) | ^~~~~~~~~~~~~ a.cpp: In function ‘int main()’: a.cpp:46:16: error: no matching function for call to ‘BigInt::BigInt()’ 46 | BigInt a, b, c; | ^ a.cpp:9:5: note: candidate: ‘BigInt::BigInt(std::string)’ 9 | BigInt(string s):number(s);//构造函数 | ^~~~~~ a.cpp:9:5: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(const BigInt&)’ 6 | class BigInt | ^~~~~~ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(BigInt&&)’ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:46:19: error: no matching function for call to ‘BigInt::BigInt()’ 46 | BigInt a, b, c; | ^ a.cpp:9:5: note: candidate: ‘BigInt::BigInt(std::string)’ 9 | BigInt(string s):number(s);//构造函数 | ^~~~~~ a.cpp:9:5: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(const BigInt&)’ 6 | class BigInt | ^~~~~~ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(BigInt&&)’ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:46:22: error: no matching function for call to ‘BigInt::BigInt()’ 46 | BigInt a, b, c; | ^ a.cpp:9:5: note: candidate: ‘BigInt::BigInt(std::string)’ 9 | BigInt(string s):number(s);//构造函数 | ^~~~~~ a.cpp:9:5: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(const BigInt&)’ 6 | class BigInt | ^~~~~~ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:6:7: note: candidate: ‘BigInt::BigInt(BigInt&&)’ a.cpp:6:7: note: candidate expects 1 argument, 0 provided a.cpp:47:14: error: use of deleted function ‘std::basic_istream<_CharT, _Traits>::basic_istream(const std::basic_istream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ 47 | cin>>a>>b; | ^ In file included from /usr/include/c++/11/iostream:40, from a.cpp:1: /usr/include/c++/11/istream:611:7: note: declared here 611 | basic_istream(const basic_istream&) = delete; | ^~~~~~~~~~~~~ a.cpp:11:39: note: initializing argument 1 of ‘std::istream operator>>(std::istream, BigInt)’ 11 | friend istream operator>>(istream in,BigInt b) | ~~~~~~~~^~ a.cpp:49:13: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘BigInt’) 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ~~~~^~~ | | | | | BigInt | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:108:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/11/ostream:108:36: note: no known conversion for argument 1 from ‘BigInt’ to ‘std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)’ {aka ‘std::basic_ostream<char>& (*)(std::basic_ostream<char>&)’} 108 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/ostream:117:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]’ 117 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/11/ostream:117:32: note: no known conversion for argument 1 from ‘BigInt’ to ‘std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)’ {aka ‘std::basic_ios<char>& (*)(std::basic_ios<char>&)’} 117 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/11/ostream:127:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 127 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/11/ostream:127:30: note: no known conversion for argument 1 from ‘BigInt’ to ‘std::ios_base& (*)(std::ios_base&)’ 127 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/11/ostream:166:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 166 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/11/ostream:166:23: note: no known conversion for argument 1 from ‘BigInt’ to ‘long int’ 166 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/11/ostream:170:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 170 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/11/ostream:170:32: note: no known conversion for argument 1 from ‘BigInt’ to ‘long unsigned int’ 170 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/11/ostream:174:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 174 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/11/ostream:174:23: note: no known conversion for argument 1 from ‘BigInt’ to ‘bool’ 174 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/11/ostream:829, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/bits/ostream.tcc:91:5: note: candidate: ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]’ 91 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/ostream.tcc:92:22: note: no known conversion for argument 1 from ‘BigInt’ to ‘short int’ 92 | operator<<(short __n) | ~~~~~~^~~ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:181:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 181 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/11/ostream:181:33: note: no known conversion for argument 1 from ‘BigInt’ to ‘short unsigned int’ 181 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/11/ostream:829, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/bits/ostream.tcc:105:5: note: candidate: ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]’ 105 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/ostream.tcc:106:20: note: no known conversion for argument 1 from ‘BigInt’ to ‘int’ 106 | operator<<(int __n) | ~~~~^~~ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:192:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 192 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/11/ostream:192:31: note: no known conversion for argument 1 from ‘BigInt’ to ‘unsigned int’ 192 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/11/ostream:201:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 201 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/11/ostream:201:28: note: no known conversion for argument 1 from ‘BigInt’ to ‘long long int’ 201 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/11/ostream:205:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 205 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/11/ostream:205:37: note: no known conversion for argument 1 from ‘BigInt’ to ‘long long unsigned int’ 205 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/ostream:220:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 220 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/11/ostream:220:25: note: no known conversion for argument 1 from ‘BigInt’ to ‘double’ 220 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/11/ostream:224:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 224 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/11/ostream:224:24: note: no known conversion for argument 1 from ‘BigInt’ to ‘float’ 224 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/11/ostream:232:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 232 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/11/ostream:232:30: note: no known conversion for argument 1 from ‘BigInt’ to ‘long double’ 232 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/11/ostream:245:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]’ 245 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/11/ostream:245:30: note: no known conversion for argument 1 from ‘BigInt’ to ‘const void*’ 245 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/11/ostream:250:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]’ 250 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/11/ostream:250:18: note: no known conversion for argument 1 from ‘BigInt’ to ‘std::nullptr_t’ 250 | operator<<(nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/11/ostream:829, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/bits/ostream.tcc:119:5: note: candidate: ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]’ 119 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/ostream.tcc:120:34: note: no known conversion for argument 1 from ‘BigInt’ to ‘std::basic_ostream<char>::__streambuf_type*’ {aka ‘std::basic_streambuf<char>*’} 120 | operator<<(__streambuf_type* __sbin) | ~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/11/bits/basic_string.h:48, from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/string_view:667:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::basic_string_view<_CharT, _Traits>)’ 667 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/11/string_view:667:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: ‘BigInt’ is not derived from ‘std::basic_string_view<_CharT, _Traits>’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/bits/basic_string.h:6531:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)’ 6531 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6531:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: ‘BigInt’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/bits/ios_base.h:46, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/system_error:279:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::error_code&)’ 279 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/11/system_error:279:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const std::error_code&’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:513:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)’ 513 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/11/ostream:513:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: deduced conflicting types for parameter ‘_CharT’ (‘char’ and ‘BigInt’) 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:518:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)’ 518 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/11/ostream:518:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:524:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)’ 524 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/11/ostream:524:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:530:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)’ 530 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/11/ostream:530:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘signed char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:535:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)’ 535 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/11/ostream:535:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘unsigned char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:544:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, wchar_t)’ (deleted) 544 | operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:544:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘wchar_t’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:549:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t)’ (deleted) 549 | operator<<(basic_ostream<char, _Traits>&, char8_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:549:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘char8_t’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:554:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char16_t)’ (deleted) 554 | operator<<(basic_ostream<char, _Traits>&, char16_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:554:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘char16_t’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:558:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char32_t)’ (deleted) 558 | operator<<(basic_ostream<char, _Traits>&, char32_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:558:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘char32_t’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:564:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, char8_t)’ (deleted) 564 | operator<<(basic_ostream<wchar_t, _Traits>&, char8_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:564:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:569:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, char16_t)’ (deleted) 569 | operator<<(basic_ostream<wchar_t, _Traits>&, char16_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:569:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:573:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, char32_t)’ (deleted) 573 | operator<<(basic_ostream<wchar_t, _Traits>&, char32_t) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:573:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:594:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)’ 594 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/11/ostream:594:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘const _CharT*’ and ‘BigInt’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/ostream:829, from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/bits/ostream.tcc:321:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)’ 321 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/11/bits/ostream.tcc:321:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const char*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:611:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)’ 611 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/11/ostream:611:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const char*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:624:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)’ 624 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/11/ostream:624:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const signed char*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:629:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)’ 629 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/11/ostream:629:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const unsigned char*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:638:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const wchar_t*)’ (deleted) 638 | operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:638:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const wchar_t*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:643:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char8_t*)’ (deleted) 643 | operator<<(basic_ostream<char, _Traits>&, const char8_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:643:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const char8_t*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:648:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char16_t*)’ (deleted) 648 | operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:648:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const char16_t*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:652:5: note: candidate: ‘template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char32_t*)’ (deleted) 652 | operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:652:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: cannot convert ‘a’ (type ‘BigInt’) to type ‘const char32_t*’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:658:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, const char8_t*)’ (deleted) 658 | operator<<(basic_ostream<wchar_t, _Traits>&, const char8_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:658:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:663:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, const char16_t*)’ (deleted) 663 | operator<<(basic_ostream<wchar_t, _Traits>&, const char16_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:663:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:667:5: note: candidate: ‘template<class _Traits> std::basic_ostream<wchar_t, _Traits>& std::operator<<(std::basic_ostream<wchar_t, _Traits>&, const char32_t*)’ (deleted) 667 | operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete; | ^~~~~~~~ /usr/include/c++/11/ostream:667:5: note: template argument deduction/substitution failed: a.cpp:49:15: note: mismatched types ‘wchar_t’ and ‘char’ 49 | cout<<a<<"+"<<b<<"="<<c<<endl; | ^ In file included from /usr/include/c++/11/iostream:39, from a.cpp:1: /usr/include/c++/11/ostream:750:5: note: candidate: ‘template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)’ 750 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/11/ostream:750:5: note: template argument deduction/substitution failed: /usr/include/c++/11/ostream: In substitution of ‘template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = BigInt]’: a.cpp:49:8: required from here /usr/include/c++/11/ostream:750:5: error: template constraint failure for ‘template<class _Os, class _Tp> requires (__derived_from_ios_base<_Os>) && requires(_Os& __os, const _Tp& __t) {__os << __t;} using __rvalue_stream_insertion_t = _Os&&’ /usr/include/c++/11/ostream:750:5: note: constraints not satisfied /usr/include/c++/11/ostream: In substitution of ‘template<class _Os, class _Tp> requires (__derived_from_ios_base<_Os>) && requires(_Os& __os, const _Tp& __t) {__os << __t;} using __rvalue_stream_insertion_t = _Os&& [with _Os = std::basic_ostream<char>&; _Tp = BigInt]’: /usr/include/c++/11/ostream:750:5: required by substitution of ‘template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = BigInt]’ a.cpp:49:8: required from here /usr/include/c++/11/ostream:717:13: required for the satisfaction of ‘__derived_from_ios_base<_Os>’ [with _Os = std::basic_ostream<char, std::char_traits<char> >&] /usr/include/c++/11/ostream:717:39: note: the expression ‘is_class_v<_Tp> [with _Tp = std::basic_ostream<char, std::char_traits<char> >&]’ evaluated to ‘false’ 717 | concept __derived_from_ios_base = is_class_v<_Tp> | ^~~~~~~~~~~~~~~
11-15
基于可靠性评估序贯蒙特卡洛模拟法的配电网可靠性评估研究(Matlab代码实现)内容概要:本文围绕“基于可靠性评估序贯蒙特卡洛模拟法的配电网可靠性评估研究”,介绍了利用Matlab代码实现配电网可靠性的仿真分析方法。重点采用序贯蒙特卡洛模拟法对配电网进行长时间段的状态抽样与统计,通过模拟系统元件的故障与修复过程,评估配电网的关键可靠性指标,如系统停电频率、停电持续时间、负荷点可靠性等。该方法能够有效处理复杂网络结构与设备时序特性,提升评估精度,适用于含分布式电源、电动汽车等新型负荷接入的现代配电网。文中提供了完整的Matlab实现代码与案例分析,便于复现和扩展应用。; 适合人群:具备电力系统基础知识和Matlab编程能力的高校研究生、科研人员及电力行业技术人员,尤其适合从事配电网规划、运行与可靠性分析相关工作的人员; 使用场景及目标:①掌握序贯蒙特卡洛模拟法在电力系统可靠性评估中的基本原理与实现流程;②学习如何通过Matlab构建配电网仿真模型并进行状态转移模拟;③应用于含新能源接入的复杂配电网可靠性定量评估与优化设计; 阅读建议:建议结合文中提供的Matlab代码逐段调试运行,理解状态抽样、故障判断、修复逻辑及指标统计的具体实现方式,同时可扩展至不同网络结构或加入更多不确定性因素进行深化研究。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值