QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
frequency.cpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2004, 2005, 2006 Ferdinando Ametrano
5 Copyright (C) 2006 Katiuscia Manzoni
6 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
7 Copyright (C) 2003, 2004, 2005, 2006, 2008 StatPro Italia srl
8
9 This file is part of QuantLib, a free-software/open-source library
10 for financial quantitative analysts and developers - http://quantlib.org/
11
12 QuantLib is free software: you can redistribute it and/or modify it
13 under the terms of the QuantLib license. You should have received a
14 copy of the license along with this program; if not, please email
15 <quantlib-dev@lists.sf.net>. The license is also available online at
16 <http://quantlib.org/license.shtml>.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the license for more details.
21*/
22
23#include <ql/time/frequency.hpp>
24#include <ql/types.hpp>
25#include <ql/errors.hpp>
26
27namespace QuantLib {
28
29 std::ostream& operator<<(std::ostream& out, Frequency f) {
30 switch (f) {
31 case NoFrequency:
32 return out << "No-Frequency";
33 case Once:
34 return out << "Once";
35 case Annual:
36 return out << "Annual";
37 case Semiannual:
38 return out << "Semiannual";
40 return out << "Every-Fourth-Month";
41 case Quarterly:
42 return out << "Quarterly";
43 case Bimonthly:
44 return out << "Bimonthly";
45 case Monthly:
46 return out << "Monthly";
47 case EveryFourthWeek:
48 return out << "Every-fourth-week";
49 case Biweekly:
50 return out << "Biweekly";
51 case Weekly:
52 return out << "Weekly";
53 case Daily:
54 return out << "Daily";
55 case OtherFrequency:
56 return out << "Unknown frequency";
57 default:
58 QL_FAIL("unknown frequency (" << Integer(f) << ")");
59 }
60 }
61
62}
Classes and functions for error handling.
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Definition: errors.hpp:92
Frequency enumeration.
Frequency
Frequency of events.
Definition: frequency.hpp:37
@ Monthly
once a month
Definition: frequency.hpp:44
@ Biweekly
every second week
Definition: frequency.hpp:46
@ EveryFourthWeek
every fourth week
Definition: frequency.hpp:45
@ Weekly
once a week
Definition: frequency.hpp:47
@ OtherFrequency
some other unknown frequency
Definition: frequency.hpp:49
@ Annual
once a year
Definition: frequency.hpp:39
@ Daily
once a day
Definition: frequency.hpp:48
@ Bimonthly
every second month
Definition: frequency.hpp:43
@ Once
only once, e.g., a zero-coupon
Definition: frequency.hpp:38
@ Quarterly
every third month
Definition: frequency.hpp:42
@ EveryFourthMonth
every fourth month
Definition: frequency.hpp:41
@ Semiannual
twice a year
Definition: frequency.hpp:40
@ NoFrequency
null frequency
Definition: frequency.hpp:37
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Definition: any.hpp:35
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)
Custom types.